Added diagonal ramps
This commit is contained in:
@@ -7,7 +7,7 @@ from editortool.map.mapinfopanel import MapInfoPanel
|
||||
from editortool.map.menubar import MapMenubar
|
||||
from editortool.map.statusbar import StatusBar
|
||||
from editortool.map.map import Map
|
||||
from editortool.map.mapdefs import CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH
|
||||
from dusk.defs import CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, TILE_SHAPE_NULL, TILE_SHAPE_FLOOR
|
||||
from editortool.map.selectbox import SelectBox
|
||||
from editortool.map.camera import Camera
|
||||
from editortool.map.grid import Grid
|
||||
@@ -73,10 +73,7 @@ class MapWindow(QMainWindow):
|
||||
QMessageBox.Save
|
||||
)
|
||||
if reply == QMessageBox.Save:
|
||||
self.saveFile()
|
||||
if self.map.isDirty():
|
||||
event.ignore()
|
||||
return
|
||||
self.map.save()
|
||||
elif reply == QMessageBox.Cancel:
|
||||
event.ignore()
|
||||
return
|
||||
@@ -109,4 +106,16 @@ class MapWindow(QMainWindow):
|
||||
self.map.moveRelative(amtX, amtY, amtZ)
|
||||
event.accept()
|
||||
return True
|
||||
|
||||
if key == Qt.Key_Delete:
|
||||
tile = self.map.getTileAtWorldPos(*self.map.position)
|
||||
if tile is not None:
|
||||
tile.setShape(TILE_SHAPE_NULL)
|
||||
event.accept()
|
||||
return True
|
||||
if key == Qt.Key_Insert:
|
||||
tile = self.map.getTileAtWorldPos(*self.map.position)
|
||||
if tile is not None and tile.shape == TILE_SHAPE_NULL:
|
||||
tile.setShape(TILE_SHAPE_FLOOR)
|
||||
event.accept()
|
||||
return super().eventFilter(obj, event)
|
||||
Reference in New Issue
Block a user