Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/mapnav.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-03-11 02:22:43 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-03-11 02:22:43 (GMT)
commite274b22684592329fcdd0b9535f2e87204e32a96 (patch)
tree8d94981807870985409150a035d5a1f04d1ea8bb /mapnav.py
parentd5df5b9ea15347a00a90297255c6ab6a3ab35228 (diff)
Clean the cache in the playing view for wall info modified in the edition map
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'mapnav.py')
-rw-r--r--mapnav.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/mapnav.py b/mapnav.py
index 02f8282..dee38c1 100644
--- a/mapnav.py
+++ b/mapnav.py
@@ -34,7 +34,12 @@ class MapNavView(gtk.DrawingArea):
__gsignals__ = {'position-changed': (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
([gobject.TYPE_INT, gobject.TYPE_INT,
- gobject.TYPE_STRING]))}
+ gobject.TYPE_STRING])),
+ 'map-updated': (gobject.SIGNAL_RUN_FIRST,
+ gobject.TYPE_NONE,
+ ([gobject.TYPE_INT, gobject.TYPE_INT,
+ gobject.TYPE_STRING])),}
+
MODE_PLAY = 0
MODE_EDIT = 1
@@ -180,10 +185,15 @@ class MapNavView(gtk.DrawingArea):
self.draw(ctx)
return False
+ def receive_update_wall_info(self, mapnav, x, y, direction):
+ self.update_wall_info(x, y, direction, redraw=False)
+
def update_wall_info(self, x, y, direction, redraw=True):
key = str(x) + direction + str(y)
if key in self.cache_info:
del self.cache_info[key]
+ if self.view_mode == self.MODE_EDIT:
+ self.emit('map-updated', self.x, self.y, self.direction)
if redraw:
self.queue_draw()