changeset 223:19aae2b701d1

More layout tweaking
author Neil Muller <drnlmuller@gmail.com>
date Sat, 12 May 2012 21:28:43 +0200
parents 69941f04f1c0
children e4f9513c9dd0
files data/images/equip_grey.png data/images/mission_selected.png data/images/science_down.png data/images/science_normal.png gamelib/gamegui.py
diffstat 5 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
Binary file data/images/equip_grey.png has changed
Binary file data/images/mission_selected.png has changed
Binary file data/images/science_down.png has changed
Binary file data/images/science_normal.png has changed
--- a/gamelib/gamegui.py	Sat May 12 21:07:51 2012 +0200
+++ b/gamelib/gamegui.py	Sat May 12 21:28:43 2012 +0200
@@ -167,6 +167,7 @@
 class MissionWidget(BigButton):
 
     WIDTH = 260
+    HEIGHT = 48
 
     BG_IMAGE_NORMAL = image.load(filepath('images/science_normal.png'))
     BG_IMAGE_DOWN = image.load(filepath('images/science_down.png'))
@@ -235,6 +236,7 @@
 class EquipWidget(BigButton):
 
     WIDTH = 260
+    HEIGHT = 48
 
     BG_IMAGE_NORMAL = image.load(filepath('images/science_normal.png'))
     BG_IMAGE_DOWN = image.load(filepath('images/science_down.png'))
@@ -289,23 +291,23 @@
         self.add_child(cancel)
         reset = ResetButton(self, 'Clear inventory')
         self.add_child(reset)
-        title = TextBox((170, 20, 370, 50), "Choose equipment for %s"
+        title = TextBox((170, 10, 370, 50), "Choose equipment for %s"
                 % mission.NAME, font_medium, (255, 255, 255))
         self.add_child(title)
-        self.description = TextBox((10, 70, 790, 20),
+        self.description = TextBox((10, 60, 790, 20),
                 mission.get_description(), font_medium, (255, 255, 255))
         self.add_child(self.description)
         self.parent = parent
         self.game = game
-        self.money = ValueLabel((10, self.description.rect.height + 75),
+        self.money = ValueLabel((10, self.description.rect.height + 57),
                 'Money')
         self.money.set_value(self.game.money)
-        self.minions = ValueLabel((310, self.description.rect.height + 75),
+        self.minions = ValueLabel((310, self.description.rect.height + 57),
                 'Minions Assigned')
         self.minions.set_value(self.parent.minions)
         self.add_child(self.money)
         self.add_child(self.minions)
-        inventory = TextLabel((10, self.description.rect.height + 90, 400, 20),
+        inventory = TextLabel((10, self.description.rect.height + 75, 400, 20),
                 'Current Inventory', font_medium, (255, 255, 255))
         self.add_child(inventory)
         self._equip = []
@@ -348,7 +350,7 @@
         self._equip = []
         x = 0
         y = max(250, 130 + self.description.rect.height +
-                20 * len(self._inventory) // 3)
+                18 * len(self._inventory) // 3)
         available = self.game.get_available_equipment()
         for equip in sorted(self.game.get_all_equipment(),
                 key=lambda x: x.NAME):
@@ -360,7 +362,7 @@
             x += widget.WIDTH + 10
             if x >= WIDTH:
                 x = 0
-                y += 65
+                y += 45
 
     def buy(self, equip):
         self.game.money -= equip.COST