diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-03-19 01:30:32 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-03-19 01:30:32 (GMT) |
commit | 98b216439cc9b47121d656bf5a06fa6ff051f6bc (patch) | |
tree | b1cd8726828a513640c870d143e2af00eda1d2db /mapnav.py | |
parent | 64c89235f1a8b23d110739409c163a3576ea8315 (diff) |
Show the map in the same context in the mapview in play mode
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'mapnav.py')
-rw-r--r-- | mapnav.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -14,7 +14,7 @@ import rsvg from sugar.graphics.style import Color from game_map import GameMap -from mapview import TopMapView +import mapview WIDTH_CONTROL_LINES = 2 RESIZE_HANDLE_SIZE = 10 @@ -216,6 +216,13 @@ class MapNavView(gtk.DrawingArea): event.area.height) ctx.clip() self.draw(ctx) + + if self.view_mode == self.MODE_PLAY: + position = {'x': self.x, 'y': self.y, 'direction': self.direction} + view_data = {'width': 150, 'height': 150, + 'show_position': position, 'x': rect.width - 150, 'y': 30} + mapview.draw(ctx, self._game_map, view_data) + return False def receive_update_wall_info(self, mapnav, x, y, direction): @@ -510,7 +517,7 @@ def main(): window = gtk.Window() game_map = GameMap() nav_view = MapNavView(game_map) - top_view = TopMapView(game_map, 200, 200) + top_view = mapview.TopMapView(game_map, 200, 200) top_view.show_position(nav_view.x, nav_view.y, nav_view.direction) nav_view.connect('position-changed', show_position, top_view) hbox = gtk.HBox() |