From: Simon Cross Date: Sat, 10 Sep 2016 14:19:40 +0000 (+0200) Subject: Merge branch 'master' of ctpug.org.za:tabakrolletjie X-Git-Tag: tabakrolletjie-v1.0.0~97 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=ed02eb3de3b7de8b9555ae1a0956d349e4f15628;p=tabakrolletjie.git Merge branch 'master' of ctpug.org.za:tabakrolletjie --- ed02eb3de3b7de8b9555ae1a0956d349e4f15628 diff --cc tabakrolletjie/scenes/day.py index 4ab14e7,334e59f..4cc42f8 --- a/tabakrolletjie/scenes/day.py +++ b/tabakrolletjie/scenes/day.py @@@ -9,14 -10,14 +10,14 @@@ import pymun import pymunk.pygame_util from .base import BaseScene -from ..lights import LightManager +from ..lights import LightManager, light_fitting_by_type from ..obstacles import ObstacleManager from ..events import SceneChangeEvent - from ..utils import debug_timer + from ..utils import debug_timer, shadowed_text from ..loader import loader -from ..transforms import Overlay, Multiply, Alpha +from ..transforms import Overlay, Alpha, ColourWedges -from ..constants import SCREEN_SIZE, FONTS, COLOURS +from ..constants import SCREEN_SIZE, FONTS from ..widgets import ImageButton from ..turnip import Turnip, TurnipInvalidPosition @@@ -98,18 -123,17 +123,21 @@@ class DayScene(BaseScene) for light_tool in self._light_toolbar: light_tool.render(surface) self._draw_cursor(surface) + if self._game_over_text: + for surf, pos in self._game_over_text: + surface.blit(surf, pos) def _draw_light_toolbar(self, light_config, x): - self._light_toolbar = [] height = SCREEN_SIZE[1] - 80 - for color in sorted(COLOURS.keys()): - light_tool = ImageButton('32', light_config["type"] + '.png', - pos=(x, height), name=color, - transform=Multiply(colour=COLOURS[color])) + self._light_toolbar = [] + colour_combos = light_config["available_colours"] + for combo in colour_combos: + colours = combo.split("/") + light_fitting = light_fitting_by_type(light_config["type"]) + light_tool = ImageButton( + "32", light_fitting, transform=ColourWedges(colours=colours), + pos=(x, height), name=combo) + light_tool.colours = colours self._light_toolbar.append(light_tool) x += 40