# HG changeset patch # User Jeremy Thurgood # Date 1282683429 -7200 # Node ID 29ba5456e8b311fb1bb2e29072a5eb66cc0a3777 # Parent d15270c2898c6cdbcdcb6f318e149d3e92fea17f Removed a bunch of cruft. diff -r d15270c2898c -r 29ba5456e8b3 gamelib/gamescreen.py --- a/gamelib/gamescreen.py Tue Aug 24 22:49:14 2010 +0200 +++ b/gamelib/gamescreen.py Tue Aug 24 22:57:09 2010 +0200 @@ -22,10 +22,9 @@ sel_color = Color("yellow") sel_width = 2 - def __init__(self, state, handbutton): + def __init__(self, state): PaletteView.__init__(self, (BUTTON_SIZE, BUTTON_SIZE), 1, 6, scrolling=True) self.state = state - self.handbutton = handbutton def num_items(self): return len(self.state.inventory) @@ -36,7 +35,6 @@ def click_item(self, item_no, event): self.state.set_tool(self.state.inventory[item_no]) - self.handbutton.unselect() def item_is_selected(self, item_no): return self.state.tool is self.state.inventory[item_no] @@ -153,21 +151,24 @@ self.handbutton = HandButton(action=self.hand_pressed) - self.inventory = InventoryView(self.state, self.handbutton) - - self.testbutton = Button('Test', lambda: self.state_widget.show_detail('cryo_detail')) + self.inventory = InventoryView(self.state) self.toolbar = ToolBar([ self.menubutton, self.handbutton, self.inventory, - self.testbutton, ]) self.toolbar.bottomleft = self.bottomleft self.add(self.toolbar) self.running = True + def enter_screen(self): + CursorWidget.enter_screen(self) + + def leave_screen(self): + CursorWidget.leave_screen(self) + # Albow uses magic method names (command + '_cmd'). Yay. # Albow's search order means they need to be defined here, not in # PopMenu, which is annoying. @@ -175,12 +176,6 @@ # This option does nothing, but the method needs to exist for albow return - def enter_screen(self): - CursorWidget.enter_screen(self) - - def leave_screen(self): - CursorWidget.leave_screen(self) - def main_menu_cmd(self): self.shell.show_screen(self.shell.menu_screen) @@ -188,7 +183,6 @@ self.shell.quit() def hand_pressed(self): - self.handbutton.toggle_selected() self.inventory.unselect() def begin_frame(self): diff -r d15270c2898c -r 29ba5456e8b3 gamelib/hand.py --- a/gamelib/hand.py Tue Aug 24 22:49:14 2010 +0200 +++ b/gamelib/hand.py Tue Aug 24 22:57:09 2010 +0200 @@ -12,26 +12,9 @@ class HandButton(ImageButton): """The fancy hand button for the widget""" - sel_colour = Color('red') - sel_width = 2 - def __init__(self, action): # FIXME: Yes, please. this_image = get_image('items', 'hand.png') ImageButton.__init__(self, image=this_image, action=action) - self.selected = False # Flag if we're selected self.set_rect(Rect(0, 0, BUTTON_SIZE, BUTTON_SIZE)) - def draw(self, surface): - """Draw the widget""" - ImageButton.draw(self, surface) - if self.selected: - rect = surface.get_rect().inflate(-self.sel_width, -self.sel_width) - frame_rect(surface, self.sel_colour, rect, self.sel_width) - - def toggle_selected(self): - self.selected = not self.selected - - def unselect(self): - self.selected = False - diff -r d15270c2898c -r 29ba5456e8b3 gamelib/scenes/cryo.py --- a/gamelib/scenes/cryo.py Tue Aug 24 22:49:14 2010 +0200 +++ b/gamelib/scenes/cryo.py Tue Aug 24 22:57:09 2010 +0200 @@ -108,13 +108,6 @@ 'door': "shut", } - SPEECH = [ - "Sadly, this isn't that sort of game.", - "Your valiant efforts are foiled by the Evil Game Designer.", - "The door resists. Try something else, perhaps?", - "You bang on the door with the titanium femur. It makes a clanging sound.", - ] - def interact_with_titanium_leg(self, item): if self.get_data('door') == "ajar": self.open_door() @@ -133,7 +126,7 @@ return Result("It moves slightly and then stops. A chain on the other side is preventing it from opening completely.") else: self.state.set_current_scene('map') - return Result("You leave the room, hoping to never return.") + return None def interact_default(self, item): return Result(random.choice([