# HG changeset patch # User Neil Muller # Date 1329043650 -7200 # Node ID 122204fb6eb1e57731305981f09baf00fafc8b30 # Parent 7cc0da0a4633d364355a7a4cb9827aa5bb4515cc Defer drawing description to StateWidget diff -r 7cc0da0a4633 -r 122204fb6eb1 pyntnclick/gamescreen.py --- 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: diff -r 7cc0da0a4633 -r 122204fb6eb1 pyntnclick/state.py --- 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.