changeset 125:d3ca34a664fd

Some detail view and data cleanup.
author Jeremy Thurgood <firxen@gmail.com>
date Tue, 24 Aug 2010 18:01:42 +0200
parents 97322b78d1c1
children f125bb60d7de
files Resources/images/cryo/triangle.png gamelib/gamescreen.py gamelib/scenes/cryo.py gamelib/state.py
diffstat 4 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
Binary file Resources/images/cryo/triangle.png has changed
--- a/gamelib/gamescreen.py	Tue Aug 24 17:55:47 2010 +0200
+++ b/gamelib/gamescreen.py	Tue Aug 24 18:01:42 2010 +0200
@@ -127,6 +127,8 @@
 
 class ToolBar(Row):
     def __init__(self, items):
+        for item in items:
+            item.height = BUTTON_SIZE
         Row.__init__(self, items, spacing=0, width=SCREEN[0])
 
 
--- a/gamelib/scenes/cryo.py	Tue Aug 24 17:55:47 2010 +0200
+++ b/gamelib/scenes/cryo.py	Tue Aug 24 18:01:42 2010 +0200
@@ -20,7 +20,6 @@
 
     def __init__(self, state):
         super(Cryo, self).__init__(state)
-        self.add_item(Triangle("triangle"))
         self.add_item(TitaniumLeg("titanium_leg"))
         self.add_thing(CryoUnitAlpha())
         self.add_thing(CryoRoomDoor())
@@ -36,11 +35,6 @@
                     " prison officials when we reach the destination."
                     " Please report to the bridge.")
 
-class Triangle(Item):
-    "Test item. Needs to go away at some point."
-
-    INVENTORY_IMAGE = "triangle.png"
-
 
 class TitaniumLeg(Item):
     "Titanium leg, found on a piratical corpse."
@@ -165,13 +159,13 @@
     INITIAL = "info"
 
 
-class CryoTriangle(Thing):
+class TitaniumLegThing(Thing):
     "Triangle in the cryo room."
 
-    NAME = "cryo.triangle"
+    NAME = "cryo.titanium_leg"
 
     INTERACTS = {
-        "triangular": InteractImage(50, 50, "door_open.png"),
+        "triangular": InteractImage(50, 50, "triangle.png"),
         }
 
     INITIAL = "triangular"
@@ -193,8 +187,7 @@
 
     def __init__(self, state):
         super(CryoUnitWithCorpse, self).__init__(state)
-        self.add_thing(CryoTriangle())
-
+        self.add_thing(TitaniumLegThing())
 
 
 SCENES = [Cryo]
--- a/gamelib/state.py	Tue Aug 24 17:55:47 2010 +0200
+++ b/gamelib/state.py	Tue Aug 24 18:01:42 2010 +0200
@@ -94,7 +94,7 @@
             self.current_detail = None
         else:
             self.current_detail = self.detail_views[name]
-            return self.current_detail.SIZE
+            return self.current_detail.get_detail_size()
 
     def add_inventory_item(self, name):
         self.inventory.append(self.items[name])
@@ -186,6 +186,9 @@
     # name of scene (optional, defaults to folder)
     NAME = None
 
+    # size (for detail views)
+    SIZE = constants.SCENE_SIZE
+
     def __init__(self, state):
         StatefulGizmo.__init__(self)
         # scene name
@@ -291,6 +294,9 @@
                     thing.get_description())
                 break
 
+    def get_detail_size(self):
+        return self.SIZE
+
 
 class Interact(object):