From eb6f4d6d8cc6d895c7c6185b20eb93da1fdd8b3b Mon Sep 17 00:00:00 2001 From: XaviDCR92 Date: Wed, 27 Dec 2017 13:08:36 +0100 Subject: * Added "Save map" function to MapEditor. * Tiles can be now modified runtime. + tileset.ini now allows configuring tileset layout in an easy way. --- Source/MapEditor/mygraphicsscene.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'Source/MapEditor/mygraphicsscene.cpp') diff --git a/Source/MapEditor/mygraphicsscene.cpp b/Source/MapEditor/mygraphicsscene.cpp index 391931e..e108375 100644 --- a/Source/MapEditor/mygraphicsscene.cpp +++ b/Source/MapEditor/mygraphicsscene.cpp @@ -6,15 +6,27 @@ MyGraphicsScene::MyGraphicsScene() } +MyGraphicsScene::~MyGraphicsScene() +{ + +} + void MyGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) { QGraphicsItem *it = this->itemAt(mouseEvent->scenePos(), QTransform()); - if (it != NULL) - { + if (it != NULL) + { + emit positionClicked(mouseEvent->scenePos()); } else { // No items selected + emit noItemSelected(); } } + +void MyGraphicsScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *) +{ + emit updateSelectedItem(); +} -- cgit v1.2.3