diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-02-13 01:03:07 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-02-13 01:03:07 (GMT) |
commit | 03be821e6a5fcee2ad7a3dbd433276357ed4b8ae (patch) | |
tree | 9d0c61c0fbe7eaf273e736265b39aaf5e8c5546f /activity.py | |
parent | 4ad228fbf024e6f7ca6026d367714533e07b5f4e (diff) |
Add window to edit the map in the activity.
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'activity.py')
-rw-r--r-- | activity.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activity.py b/activity.py index 4acca3b..03c2084 100644 --- a/activity.py +++ b/activity.py @@ -35,6 +35,7 @@ from sugar.graphics.icon import Icon from model import GameModel from resources import CollectResourcesWin from questions import PrepareQuestionsWin +from editmap import EditMapWin from sugar.graphics.xocolor import XoColor sys.path.append('..') # import sugargame package from top directory. @@ -121,6 +122,7 @@ class IngeniumMachinaActivity(activity.Activity): # init edition windows self.collect_resources_win = None self.prepare_questions_win = None + self.edit_map_win = None # init game self.mode = PLAY_MODE @@ -214,7 +216,11 @@ class IngeniumMachinaActivity(activity.Activity): self.action = EDIT_RESOURCES_ACTION def __map_button_cb(self, button): - self.main_notebook.set_current_page(0) + if self.edit_map_win is None: + self.edit_map_win = EditMapWin(self.model) + button.page = self.main_notebook.get_n_pages() + self.main_notebook.append_page(self.edit_map_win) + self.main_notebook.set_current_page(button.page) self.action = EDIT_MAP_ACTION def __descriptions_button_cb(self, button): |