changeset 136:d264850806dc

Better description handling in detail windows. (Sort of.)
author Jeremy Thurgood <firxen@gmail.com>
date Tue, 24 Aug 2010 20:35:31 +0200
parents b43599b7f8a2
children 17411b984dc2
files gamelib/gamescreen.py gamelib/scenes/cryo.py gamelib/state.py
diffstat 3 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/gamescreen.py	Tue Aug 24 20:33:20 2010 +0200
+++ b/gamelib/gamescreen.py	Tue Aug 24 20:35:31 2010 +0200
@@ -112,7 +112,7 @@
             result.process(self)
 
     def mouse_move(self, event):
-        self.state.mouse_move_detail(event.pos)
+        self.state.mouse_move_detail(self.global_to_local(event.pos))
 
     def show_message(self, message):
         # Display the message as a modal dialog
--- a/gamelib/scenes/cryo.py	Tue Aug 24 20:33:20 2010 +0200
+++ b/gamelib/scenes/cryo.py	Tue Aug 24 20:35:31 2010 +0200
@@ -176,6 +176,9 @@
         self.scene.remove_thing(self)
         return Result("The skeletal occupant of this cryo unit has an artificial femur made of titanium. You take it.")
 
+    def get_description(self):
+        return "This femur looks synthetic."
+
 
 class CryoUnitWithCorpse(Scene):
 
--- a/gamelib/state.py	Tue Aug 24 20:33:20 2010 +0200
+++ b/gamelib/state.py	Tue Aug 24 20:35:31 2010 +0200
@@ -107,6 +107,7 @@
             self.current_detail = None
         else:
             self.current_detail = self.detail_views[name]
+            self.current_scene._current_description = None
             return self.current_detail.get_detail_size()
 
     def add_inventory_item(self, name):