# HG changeset patch # User Jeremy Thurgood # Date 1259405179 0 # Node ID 84964077626a8da63a7460d0b6752a139f21fd25 # Parent 03be16420e8b272a8773ee3409abe1076b9f31a1 Counter display more compact, although not as pretty as it should be. diff -r 03be16420e8b -r 84964077626a gamelib/gameboard.py --- a/gamelib/gameboard.py Sat Nov 28 10:12:00 2009 +0000 +++ b/gamelib/gameboard.py Sat Nov 28 10:46:19 2009 +0000 @@ -224,8 +224,7 @@ self.toolbar.update_chicken_counter(len(self.chickens)) self.toolbar.update_cash_counter(self.cash) self.toolbar.update_wood_counter(self.wood) - if self.killed_foxes: - self.toolbar.update_fox_counter(self.killed_foxes) + self.toolbar.update_fox_counter(self.killed_foxes) def update(self): self.tvw.reupdate() diff -r 03be16420e8b -r 84964077626a gamelib/toolbar.py --- a/gamelib/toolbar.py Sat Nov 28 10:12:00 2009 +0000 +++ b/gamelib/toolbar.py Sat Nov 28 10:46:19 2009 +0000 @@ -82,12 +82,13 @@ self.tr() self.td(gui.Spacer(self.rect.w/2, 0)) self.td(gui.Spacer(self.rect.w/2, 0)) - self.add_counter(icons.DAY_ICON, self.day_counter) + self._counter_col = 0 self.add_counter(icons.GROATS_ICON, self.cash_counter) self.add_counter(icons.WOOD_ICON, self.wood_counter) + self.add_counter(icons.CHKN_ICON, self.chicken_counter) self.add_counter(icons.EGG_ICON, self.egg_counter) - self.add_counter(icons.CHKN_ICON, self.chicken_counter) self.add_counter(icons.KILLED_FOX, self.killed_foxes) + self.add_counter(icons.DAY_ICON, self.day_counter) self.add_spacer(5) def start_night(self): @@ -239,9 +240,16 @@ item.pcls = "" def add_counter(self, icon, label): - self.tr() - self.td(icon, width=self.rect.w/2) - self.td(label, width=self.rect.w/2) + if self._counter_col == 0: + self.add_spacer(5) + self.tr() + tbl = gui.Table() + tbl.tr() + tbl.td(icon, width=self.rect.w/2) + tbl.tr() + tbl.td(label, width=self.rect.w/2) + self.td(tbl) + self._counter_col = (self._counter_col + 1) % 2 def resize(self, width=None, height=None): width, height = gui.Table.resize(self, width, height)