# HG changeset patch # User Jeremy Thurgood # Date 1282674067 -7200 # Node ID faac82748f5a4d131e02c4be2dbff534168814a3 # Parent 0530547a131f10fa25c68fa480a08b0d85ccc314 Put the leg inside the cryo unit. diff -r 0530547a131f -r faac82748f5a gamelib/gamescreen.py --- a/gamelib/gamescreen.py Tue Aug 24 19:49:10 2010 +0200 +++ b/gamelib/gamescreen.py Tue Aug 24 20:21:07 2010 +0200 @@ -114,6 +114,12 @@ def mouse_move(self, event): self.state.mouse_move_detail(event.pos) + def show_message(self, message): + # Display the message as a modal dialog + MessageDialog(message, 60).present() + # queue a redraw to show updated state + self.invalidate() + class ToolBar(Row): def __init__(self, items): diff -r 0530547a131f -r faac82748f5a gamelib/scenes/cryo.py --- a/gamelib/scenes/cryo.py Tue Aug 24 19:49:10 2010 +0200 +++ b/gamelib/scenes/cryo.py Tue Aug 24 20:21:07 2010 +0200 @@ -63,12 +63,7 @@ } def interact_without(self): - self.state.add_inventory_item('titanium_leg') - self.set_data('contains_titanium_leg', False) - return Result("The skeletal occupant of this cryo unit has an artificial femur made of titanium. You take it.") - - def is_interactive(self): - return self.get_data('contains_titanium_leg') + return Result(detail_view='cryo_detail') def get_description(self): if self.get_data('contains_titanium_leg'): @@ -169,16 +164,16 @@ NAME = "cryo.titanium_leg" INTERACTS = { - "triangular": InteractImage(50, 50, "triangle.png"), + "leg": InteractImage(50, 50, "triangle.png"), } - INITIAL = "triangular" + INITIAL = "leg" def interact_without(self): - return Result("You interacted.") - - def is_interactive(self): - return True + self.state.add_inventory_item('titanium_leg') + self.state.current_scene.things['cryo.unit.1'].set_data('contains_titanium_leg', False) + self.scene.remove_thing(self) + return Result("The skeletal occupant of this cryo unit has an artificial femur made of titanium. You take it.") class CryoUnitWithCorpse(Scene):