Mercurial > boomslang
changeset 651:122204fb6eb1 pyntnclick
Defer drawing description to StateWidget
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sun, 12 Feb 2012 12:47:30 +0200 |
parents | 7cc0da0a4633 |
children | b8cc0be3a819 |
files | pyntnclick/gamescreen.py pyntnclick/state.py |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/pyntnclick/gamescreen.py Sun Feb 12 12:33:04 2012 +0200 +++ b/pyntnclick/gamescreen.py Sun Feb 12 12:47:30 2012 +0200 @@ -86,6 +86,12 @@ # self.game.previous_scene.draw(surface, self) #else: # self.game.current_scene.draw(surface, self) + # We draw descriptions here, so we do the right thing + # with detail views + if self.game.current_detail: + self.game.current_detail.draw_description(surface) + else: + self.game.current_scene.draw_description(surface) def mouse_down(self, event, widget): if self.game.current_detail:
--- a/pyntnclick/state.py Sun Feb 12 12:33:04 2012 +0200 +++ b/pyntnclick/state.py Sun Feb 12 12:47:30 2012 +0200 @@ -323,7 +323,7 @@ #label.fg_color = (0, 0, 0) return label - def draw_description(self, surface, screen): + def draw_description(self, surface): description = self._get_description() if description is not None: description.draw(surface) @@ -351,7 +351,6 @@ def draw(self, surface, screen): self.draw_background(surface) self.draw_things(surface) - self.draw_description(surface, screen) def interact(self, item, pos): """Interact with a particular position.