diff options
Diffstat (limited to 'src/ui.py')
-rw-r--r-- | src/ui.py | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -821,10 +821,10 @@ class KPMainWindow(QtGui.QMainWindow): showDoodads = True elif isinstance(layer, KPTileLayer): - KP.map.reloadTileset(layer.tileset) + KP.loadTileset(layer.tileset) showObjects = True - self.objectSelector.setTileset(KP.map.loadedTilesets[layer.tileset]) + self.objectSelector.setTileset(KP.tileset(layer.tileset)) self.objectSelectorDock.setVisible(showObjects) self.doodadSelectorDock.setVisible(showDoodads) @@ -839,9 +839,9 @@ class KPMainWindow(QtGui.QMainWindow): self.scene.setCurrentLayer(layer) - KP.map.reloadTileset(layer.tileset) + KP.loadTileset(layer.tileset) - self.objectSelector.setTileset(KP.map.loadedTilesets[layer.tileset]) + self.objectSelector.setTileset(KP.tileset(layer.tileset)) self.objectSelectorDock.setVisible(True) self.doodadSelectorDock.setVisible(True) @@ -990,18 +990,16 @@ class KPMainWindow(QtGui.QMainWindow): if path: import shutil import os - from hashlib import sha256 as sha + # Todo: refactor this to use a KP method name = os.path.basename(path[:-4]) shutil.copy(path, 'Tilesets') filehandler = open(path) data = filehandler.read() filehandler.close() - hash = sha(data).hexdigest() - KP.map.tilesets[name] = {'path': path, 'hash': hash} - KP.map.loadedTilesets[name] = KPTileset.loadFromArc(path) + KP.knownTilesets[name] = {'path': path} @QtCore.pyqtSlot() @@ -1021,7 +1019,7 @@ class KPMainWindow(QtGui.QMainWindow): KPTileLayer.tileset = tilesetName - self.objectSelector.setTileset(KP.map.loadedTilesets[layer.tileset]) + self.objectSelector.setTileset(KP.tileset(layer.tileset)) # Animate |