diff options
author | Walter Bender <walter.bender@gmail.com> | 2011-02-12 19:06:15 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2011-02-12 19:06:15 (GMT) |
commit | 11054afbe846e2c5d6ed06a755805aceefbd61c1 (patch) | |
tree | 6cf1aef2f6618447261f2a146e06e62e4c978d19 | |
parent | 2c64a97bd12eabc11ff73df286084e3e4d2ffc74 (diff) |
added attract mode on first launch
-rw-r--r-- | VisualMatchActivity.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/VisualMatchActivity.py b/VisualMatchActivity.py index f894510..c61b84f 100644 --- a/VisualMatchActivity.py +++ b/VisualMatchActivity.py @@ -138,6 +138,10 @@ class VisualMatchActivity(activity.Activity): if not hasattr(self, '_saved_state'): self._saved_state = None self.vmw.new_game(self._saved_state, self._deck_index) + if self._saved_state == None: + # Launch "attract mode" by turning on Robot with 5 second delay + self.vmw.robot_time = 5 + self._robot_cb() if self._editing_word_list: self.vmw.editing_word_list = True @@ -154,9 +158,15 @@ class VisualMatchActivity(activity.Activity): if card_type == 'custom' and self.vmw.custom_paths[0] is None: self.image_import_cb() else: + if self.vmw.robot_time == 5: + # Turn off attract mode + if self.vmw.robot: + self._robot_cb() + self.vmw.robot_time = 15 + self._robot_time_spin.set_value(self.vmw.robot_time) self.vmw.new_game() - def _robot_cb(self, button): + def _robot_cb(self, button=None): """ Toggle robot assist on/off """ if self.vmw.robot: self.vmw.robot = False |