comparison pyntnclick/cursor.py @ 603:3ce19d33b51f pyntnclick

Rename state to game to not cause confusion with the other state
author Neil Muller <neil@dip.sun.ac.za>
date Sat, 11 Feb 2012 20:09:47 +0200
parents 1b1ab71535bd
children 2748d3afcae5
comparison
equal deleted inserted replaced
602:1aac5a3b17e1 603:3ce19d33b51f
79 def draw_all(self, surface): 79 def draw_all(self, surface):
80 Widget.draw_all(self, surface) 80 Widget.draw_all(self, surface)
81 self.draw_cursor(self.get_root().surface) 81 self.draw_cursor(self.get_root().surface)
82 82
83 def draw_cursor(self, surface): 83 def draw_cursor(self, surface):
84 self.set_cursor(self.screen.state.tool) 84 self.set_cursor(self.screen.game.tool)
85 self.cursor.set_highlight(self.cursor_highlight()) 85 self.cursor.set_highlight(self.cursor_highlight())
86 if self.cursor is not None: 86 if self.cursor is not None:
87 self._cursor_group.update() 87 self._cursor_group.update()
88 self._cursor_group.draw(surface) 88 self._cursor_group.draw(surface)
89 89
108 cls._cursor_group.add(cls.cursor) 108 cls._cursor_group.add(cls.cursor)
109 109
110 def cursor_highlight(self): 110 def cursor_highlight(self):
111 if not Rect((0, 0), SCENE_SIZE).collidepoint(pygame.mouse.get_pos()): 111 if not Rect((0, 0), SCENE_SIZE).collidepoint(pygame.mouse.get_pos()):
112 return False 112 return False
113 if self.screen.state.highlight_override: 113 if self.screen.game.highlight_override:
114 return True 114 return True
115 current_thing = self.screen.state.current_thing 115 current_thing = self.screen.game.current_thing
116 if current_thing: 116 if current_thing:
117 return current_thing.is_interactive() 117 return current_thing.is_interactive()
118 return False 118 return False