Ignore:
Timestamp:
Sep 5, 2009, 2:09:44 PM (11 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
Convert:
svn:b4e93282-eac8-4b8b-b765-0f5d36de2b68@271
Message:

Add prices to all tools where is makes sense to do so.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gamelib/gameboard.py

    r264 r270  
    8080
    8181        self.add_tool_button("Move Hen", constants.TOOL_PLACE_ANIMALS,
    82                 cursors.cursors['select'])
    83         self.add_tool_button("Cut Trees", constants.TOOL_LOGGING)
     82                None, cursors.cursors['select'])
     83        self.add_tool_button("Cut Trees", constants.TOOL_LOGGING,
     84                constants.LOGGING_PRICE)
    8485        self.add_spacer(20)
    8586
    8687        self.add_heading("Sell ...")
    8788        self.add_tool_button("Chicken", constants.TOOL_SELL_CHICKEN,
    88                 cursors.cursors['sell'])
     89                constants.SELL_PRICE_CHICKEN, cursors.cursors['sell'])
    8990        self.add_tool_button("Egg", constants.TOOL_SELL_EGG,
    90                 cursors.cursors['sell'])
     91                constants.SELL_PRICE_EGG, cursors.cursors['sell'])
    9192        self.add_tool_button("Building", constants.TOOL_SELL_BUILDING,
    92                 cursors.cursors['sell'])
     93                None, cursors.cursors['sell'])
    9394        self.add_tool_button("Equipment", constants.TOOL_SELL_EQUIPMENT,
    94                 cursors.cursors['sell'])
     95                None, cursors.cursors['sell'])
    9596        self.add_spacer(20)
    9697
     98
    9799        self.add_heading("Buy ...")
    98         self.add_tool_button("Fence", constants.TOOL_BUY_FENCE)
     100
     101        self.add_tool_button("Fence", constants.TOOL_BUY_FENCE,
     102                "%s/%s" % (constants.BUY_PRICE_FENCE,
     103                           constants.REPAIR_PRICE_FENCE))
     104
    99105        for building_cls in buildings.BUILDINGS:
    100106            self.add_tool_button(building_cls.NAME.title(), building_cls,
    101                     cursors.cursors.get('build', None))
     107                    None, cursors.cursors.get('build', None))
     108
    102109        for equipment_cls in equipment.EQUIPMENT:
    103             self.add_tool_button(equipment_cls.NAME.title(), equipment_cls,
     110            self.add_tool_button(equipment_cls.NAME.title(),
     111                    equipment_cls,
     112                    equipment_cls.BUY_PRICE,
    104113                    cursors.cursors.get('buy', None))
     114
    105115        self.add_spacer(30)
    106116
     
    125135        self.td(mklabel(text), colspan=2)
    126136
    127     def add_tool_button(self, text, tool, cursor=None):
     137    def add_tool_button(self, text, tool, price=None, cursor=None):
     138        if price is not None:
     139            text = "%s  (%s)" % (text, price)
    128140        self.add_tool(text, lambda: self.gameboard.set_selected_tool(tool,
    129141            cursor))
Note: See TracChangeset for help on using the changeset viewer.