From: Neil Date: Thu, 8 Sep 2016 17:50:10 +0000 (+0200) Subject: Add key to trigger day/night transitions for now X-Git-Tag: tabakrolletjie-v1.0.0~182 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=274f1d6fb3fcb077aa89aba219b0e34c6fa71ed9;p=tabakrolletjie.git Add key to trigger day/night transitions for now --- diff --git a/tabakrolletjie/scenes/day.py b/tabakrolletjie/scenes/day.py index 7702fc7..44d3529 100644 --- a/tabakrolletjie/scenes/day.py +++ b/tabakrolletjie/scenes/day.py @@ -40,6 +40,9 @@ class DayScene(BaseScene): if ev.key in (pgl.K_q, pgl.K_ESCAPE): from .menu import MenuScene SceneChangeEvent.post(scene=MenuScene()) + if ev.key == pgl.K_e: + from .night import NightScene + SceneChangeEvent.post(scene=NightScene()) elif ev.type == pgl.MOUSEBUTTONDOWN: if ev.button == 1: # Check tools diff --git a/tabakrolletjie/scenes/night.py b/tabakrolletjie/scenes/night.py index 6944f5f..edaa15a 100644 --- a/tabakrolletjie/scenes/night.py +++ b/tabakrolletjie/scenes/night.py @@ -32,6 +32,9 @@ class NightScene(BaseScene): if ev.key in (pgl.K_q, pgl.K_ESCAPE): from .menu import MenuScene SceneChangeEvent.post(scene=MenuScene()) + if ev.key == pgl.K_e: + from .day import DayScene + SceneChangeEvent.post(scene=DayScene()) elif ev.type == pgl.MOUSEBUTTONDOWN: if ev.button == 1: self._lights.toggle_nearest(ev.pos, surfpos=True)