diff options
Diffstat (limited to '')
-rw-r--r-- | src/mapdata.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mapdata.py b/src/mapdata.py index 67103d9..3ce63a6 100644 --- a/src/mapdata.py +++ b/src/mapdata.py @@ -25,10 +25,25 @@ class KPLayer(object): self.name = '' self.tileset = '' self.objects = [] - self.visible = True + self._visible = True self.cache = ['DUMMY_FLAG'] self.updateCache() + @property + def visible(self): + return self._visible + + @visible.setter + def visible(self, value): + if self._visible == value: + return + self._visible = value + + for obj in self.objects: + item = obj.qtItem + if item: + item.setVisible(value) + def updateCache(self): if len(self.objects) == 0: if len(self.cache) != 0: |