diff --git a/include/editor.h b/include/editor.h index 31279095..c63217ea 100644 --- a/include/editor.h +++ b/include/editor.h @@ -70,6 +70,7 @@ public: void setEditingCollision(); void setEditingObjects(); void setEditingConnections(); + void setMapEditingButtonsVisibile(bool visible); void clearWildMonTabWidgets(); void setCurrentConnectionDirection(QString curDirection); void updateCurrentConnectionDirection(QString curDirection); diff --git a/resources/icons/cursor.ico b/resources/icons/cursor.ico index b502cb04..7cab3607 100644 Binary files a/resources/icons/cursor.ico and b/resources/icons/cursor.ico differ diff --git a/resources/themes/midnight.qss b/resources/themes/midnight.qss index 879f1db4..b8e3d4d2 100644 --- a/resources/themes/midnight.qss +++ b/resources/themes/midnight.qss @@ -17,7 +17,7 @@ QWidget { } QWidget::disabled { - background: #272822; + background: #31332b; color: #75715E; } diff --git a/src/editor.cpp b/src/editor.cpp index ea4c6c9e..c103da57 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -99,6 +99,8 @@ void Editor::setEditingMap() { setConnectionItemsVisible(false); this->cursorMapTileRect->stopSingleTileMode(); this->cursorMapTileRect->setVisibility(true); + + setMapEditingButtonsVisibile(true); } void Editor::setEditingCollision() { @@ -120,6 +122,8 @@ void Editor::setEditingCollision() { setConnectionItemsVisible(false); this->cursorMapTileRect->setSingleTileMode(); this->cursorMapTileRect->setVisibility(true); + + setMapEditingButtonsVisibile(true); } void Editor::setEditingObjects() { @@ -139,6 +143,22 @@ void Editor::setEditingObjects() { setConnectionItemsVisible(false); this->cursorMapTileRect->setSingleTileMode(); this->cursorMapTileRect->setVisibility(false); + + setMapEditingButtonsVisibile(false); +} + +void Editor::setMapEditingButtonsVisibile(bool visible) { + this->ui->toolButton_Fill->setEnabled(visible); + // If the fill button is pressed, unpress it and select the pointer. + if (!visible && this->ui->toolButton_Fill->isChecked()) { + qDebug() << "deselect flood fill button"; + this->map_edit_mode = "select"; + this->settings->mapCursor = QCursor(); + this->cursorMapTileRect->setSingleTileMode(); + this->ui->toolButton_Fill->setChecked(false); + this->ui->toolButton_Select->setChecked(true); + } + this->ui->checkBox_smartPaths->setEnabled(visible); } void Editor::setEditingConnections() { @@ -987,6 +1007,7 @@ void Editor::setSmartPathCursorMode(QGraphicsSceneMouseEvent *event) } void Editor::mouseEvent_map(QGraphicsSceneMouseEvent *event, MapPixmapItem *item) { + // TODO: add event tab object painting tool buttons stuff here if (!item->paintingEnabled) { return; } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 18afecc3..1cdc8df0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2054,7 +2054,7 @@ void MainWindow::on_toolButton_Paint_clicked() void MainWindow::on_toolButton_Select_clicked() { editor->map_edit_mode = "select"; - editor->settings->mapCursor = QCursor(QPixmap(":/icons/cursor.ico"), 0, 0); + editor->settings->mapCursor = QCursor();//QPixmap(":/icons/cursor.ico"), 0, 0); editor->cursorMapTileRect->setSingleTileMode(); ui->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); diff --git a/src/ui/mappixmapitem.cpp b/src/ui/mappixmapitem.cpp index 103a15c5..8bcfef7a 100644 --- a/src/ui/mappixmapitem.cpp +++ b/src/ui/mappixmapitem.cpp @@ -558,13 +558,13 @@ void MapPixmapItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { int x = static_cast(event->pos().x()) / 16; int y = static_cast(event->pos().y()) / 16; emit this->hoveredMapMetatileChanged(x, y); - if (this->settings->betterCursors && this->paintingEnabled) { + if (this->settings->betterCursors/* && this->paintingEnabled*/) { setCursor(this->settings->mapCursor); } } void MapPixmapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *) { emit this->hoveredMapMetatileCleared(); - if (this->settings->betterCursors && this->paintingEnabled) { + if (this->settings->betterCursors/* && this->paintingEnabled*/) { unsetCursor(); } }