Mercurial > rinkhals
comparison gamelib/toolbar.py @ 566:a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sat, 28 Nov 2009 19:30:06 +0000 |
parents | 27c09c58d89d |
children | e813365af567 |
comparison
equal
deleted
inserted
replaced
565:32b6b66e114a | 566:a8dde729000a |
---|---|
4 import icons | 4 import icons |
5 import constants | 5 import constants |
6 import buildings | 6 import buildings |
7 import equipment | 7 import equipment |
8 import cursors | 8 import cursors |
9 import engine | |
10 import savegame | 9 import savegame |
11 import misc | 10 import misc |
12 | 11 |
13 class RinkhalsTool(gui.Tool): | 12 class RinkhalsTool(gui.Tool): |
14 def __init__(self, group, label, value, func, **params): | 13 def __init__(self, group, label, value, func, **params): |
333 self.gameboard.change_toolbar(EquipmentToolBar(self.gameboard, | 332 self.gameboard.change_toolbar(EquipmentToolBar(self.gameboard, |
334 width=self.style.width)) | 333 width=self.style.width)) |
335 | 334 |
336 def day_done(self): | 335 def day_done(self): |
337 if self.gameboard.day: | 336 if self.gameboard.day: |
338 pygame.event.post(engine.START_NIGHT) | 337 pygame.event.post(constants.START_NIGHT) |
339 else: | 338 else: |
340 pygame.event.post(engine.FAST_FORWARD) | 339 pygame.event.post(constants.FAST_FORWARD) |
341 | 340 |
342 class BuildingToolBar(BaseToolBar): | 341 class BuildingToolBar(BaseToolBar): |
343 | 342 |
344 def __init__(self, gameboard, **params): | 343 def __init__(self, gameboard, **params): |
345 BaseToolBar.__init__(self, gameboard, **params) | 344 BaseToolBar.__init__(self, gameboard, **params) |