Mercurial > pyntnclick
diff pyntnclick/state.py @ 576:1b1ab71535bd pyntnclick
Classify constants, which involves a whole bunch of XXX comments
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sat, 11 Feb 2012 16:02:06 +0200 |
parents | b84534a1bd2e |
children | cf65e91b30b1 |
line wrap: on
line diff
--- a/pyntnclick/state.py Sat Feb 11 16:01:33 2012 +0200 +++ b/pyntnclick/state.py Sat Feb 11 16:02:06 2012 +0200 @@ -8,8 +8,6 @@ from pygame.rect import Rect from pygame.color import Color -from pyntnclick import constants - class Result(object): """Result of interacting with a thing""" @@ -183,12 +181,12 @@ def check_enter_leave(self, screen): if not self.do_check: return None - if self.do_check == constants.LEAVE: - self.do_check = constants.ENTER + if self.do_check == self.gd.constants.leave: + self.do_check = self.gd.constants.enter if self.previous_scene: return self.previous_scene.leave() return None - elif self.do_check == constants.ENTER: + elif self.do_check == self.gd.constants.enter: self.do_check = None # Fix descriptions, etc. if self.old_pos: @@ -198,7 +196,7 @@ def set_do_enter_leave(self): """Flag that we need to run the enter loop""" - self.do_check = constants.LEAVE + self.do_check = self.gd.constants.leave class StatefulGizmo(object):