Shorter hints, which mean more space for actions in the tutorial
[naja.git] / naja / events.py
index 11adab0f7528cbd68e88adf32275d4ab39ff8be9..dbf7a03711fa1a4dd87a9ef15544332e4eddb948 100644 (file)
@@ -6,8 +6,13 @@ import pygame.event as pge
 import pygame.locals as pgl
 
 
-class NajaEvent(object):
+def finish_event(handled=True, skip_invalidate=False):
+    if not skip_invalidate:
+        InvalidateTheWorld.post()
+    return handled
+
 
+class NajaEvent(object):
     TYPE = "UNKNOWN"
 
     @classmethod
@@ -43,6 +48,9 @@ class SelectEvent(NajaEvent):
     TYPE = "SELECT"
 
 
-class PlayerMoved(NajaEvent):
-    # This is used to signal to widgets that care that the player has moved.
-    TYPE = "PLAYER_MOVED"
+class LoadGameEvent(NajaEvent):
+    TYPE = "LOAD_GAME"
+
+    @classmethod
+    def post(cls, state):
+        super(LoadGameEvent, cls).post(state=state)