Added diagonal ramps
All checks were successful
Build Dusk / build-linux (push) Successful in 55s
Build Dusk / build-psp (push) Successful in 1m4s

This commit is contained in:
2025-11-19 15:40:37 -06:00
parent bd5a67676b
commit c32df89490
20 changed files with 256 additions and 173 deletions

View File

@@ -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)