# HG changeset patch # User Simon Cross # Date 1316302623 -7200 # Node ID efe1b61aad08945bae673ed7eb0bd9f2be114949 # Parent c798ba211b6e85d9ddef6ed692c856e7adcb31be Start of help and an exit button. diff -r c798ba211b6e -r efe1b61aad08 mamba/habitats/editor.py --- a/mamba/habitats/editor.py Sun Sep 18 01:36:44 2011 +0200 +++ b/mamba/habitats/editor.py Sun Sep 18 01:37:03 2011 +0200 @@ -169,11 +169,16 @@ 'Things') thing_button.add_callback('clicked', self.change_toolbar, 'Things') sprite_button = TextButton((button_left, - button_height + thing_button.rect.height + + thing_button.rect.bottom + button_padding), 'Sprites') sprite_button.add_callback('clicked', self.change_toolbar, 'Sprites') + help_button = TextButton((sprite_button.rect.right + button_padding, + thing_button.rect.bottom + button_padding), + 'Help') + help_button.add_callback('clicked', self.show_help) + if self.mode == "Tiles": tile_button.disable() elif self.mode == "Things": @@ -183,6 +188,7 @@ self.container.add(tile_button) self.container.add(thing_button) self.container.add(sprite_button) + self.container.add(help_button) button_height = LOAD_SAVE_HEIGHT @@ -190,6 +196,11 @@ upload.add_callback('clicked', self.upload) self.container.add(upload) + mainmenu = TextButton((upload.rect.right + button_padding, + button_height), 'Exit') + mainmenu.add_callback('clicked', self.go_mainmenu) + self.container.add(mainmenu) + button_height = upload.rect.bottom + button_padding new = TextButton((button_left, button_height), "New") @@ -212,6 +223,15 @@ self.current_tool.prepare() return True + def show_help(self, ev, widget): + print "Help!" + return True + + def go_mainmenu(self, ev, widget): + from mamba.habitats.mainmenu import MainMenu + NewHabitatEvent.post(MainMenu()) + return True + def check_level(self): message = None if not self.level.level_name: