comparison gamelib/gameboard.py @ 348:e61f95503461

Add fences to price list. Tidying up price list dialog a little.
author Simon Cross <hodgestar@gmail.com>
date Sat, 05 Sep 2009 23:17:31 +0000
parents 6baf8b5beb5c
children b4ead8d2b776 90abd39e6c3c
comparison
equal deleted inserted replaced
347:35f09e0ccd16 348:e61f95503461
161 if hasattr(thing, 'style'): 161 if hasattr(thing, 'style'):
162 thing.style.width = max_width + 10 162 thing.style.width = max_width + 10
163 163
164 tbl = gui.Table() 164 tbl = gui.Table()
165 tbl.tr() 165 tbl.tr()
166 doc = gui.Document(width=400) 166 doc = gui.Document(width=380)
167 space = doc.style.font.size(" ") 167 space = doc.style.font.size(" ")
168 for header in ['Item', 'Buy Price', 'Sell Price']: 168 for header in ['Item', 'Buy Price', 'Sell Price']:
169 doc.add(make_box(header)) 169 doc.add(make_box(header))
170 doc.br(space[1]) 170 doc.br(space[1])
171 for building in buildings.BUILDINGS: 171 for building in buildings.BUILDINGS:
176 for equip in equipment.EQUIPMENT: 176 for equip in equipment.EQUIPMENT:
177 doc.add(make_box(equip.NAME)) 177 doc.add(make_box(equip.NAME))
178 doc.add(make_box('%d' % equip.BUY_PRICE)) 178 doc.add(make_box('%d' % equip.BUY_PRICE))
179 doc.add(make_box('%d' % equip.SELL_PRICE)) 179 doc.add(make_box('%d' % equip.SELL_PRICE))
180 doc.br(space[1]) 180 doc.br(space[1])
181
182 doc.add(make_box("Fence"))
183 doc.add(make_box('%d' % constants.BUY_PRICE_FENCE))
184 doc.add(make_box('%d' % constants.SELL_PRICE_FENCE))
185
186 doc.add(make_box("Repair Fence"))
187 doc.add(make_box('%d' % constants.REPAIR_PRICE_FENCE))
188 doc.add(make_box(''))
189
181 fix_widths(doc) 190 fix_widths(doc)
182 for word in "Damaged equipment will be sold for less than" \ 191 for word in "Damaged equipment or broken fences will be sold for" \
183 " the sell price.".split(): 192 " less than the sell price.".split():
184 doc.add(gui.Label(word)) 193 doc.add(gui.Label(word))
185 doc.space(space) 194 doc.space(space)
186 close_button = gui.Button("Close") 195 close_button = gui.Button("Close")
187 tbl.td(doc, colspan=3) 196 tbl.td(doc)
188 tbl.tr() 197 tbl.tr()
189 tbl.td(gui.Label('')) 198 tbl.td(close_button, align=1)
190 tbl.td(gui.Label(''))
191 tbl.td(close_button)
192 dialog = gui.Dialog(gui.Label('Price Reference'), tbl) 199 dialog = gui.Dialog(gui.Label('Price Reference'), tbl)
193 close_button.connect(gui.CLICK, dialog.close) 200 close_button.connect(gui.CLICK, dialog.close)
194 dialog.open() 201 dialog.open()
195 self.anim_clear_tool = True 202 self.anim_clear_tool = True
196 203