From 61311940656e8dfff0e32af0c0659747ac86ce8a Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Thu, 13 Sep 2018 17:48:43 -0500 Subject: [PATCH] Add keyboard shortcuts for each of the editing tool buttons --- mainwindow.cpp | 30 ++++++++++++++++++++ mainwindow.h | 6 ++++ mainwindow.ui | 74 +++++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 103 insertions(+), 7 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 985f2831..bc0b41e3 100755 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -618,6 +618,36 @@ void MainWindow::on_actionBetter_Cursors_triggered() { settings.setValue("cursor_mode", QString::number(ui->actionBetter_Cursors->isChecked())); } +void MainWindow::on_actionPencil_triggered() +{ + on_toolButton_Paint_clicked(); +} + +void MainWindow::on_actionPointer_triggered() +{ + on_toolButton_Select_clicked(); +} + +void MainWindow::on_actionFlood_Fill_triggered() +{ + on_toolButton_Fill_clicked(); +} + +void MainWindow::on_actionEyedropper_triggered() +{ + on_toolButton_Dropper_clicked(); +} + +void MainWindow::on_actionMove_triggered() +{ + on_toolButton_Move_clicked(); +} + +void MainWindow::on_actionMap_Shift_triggered() +{ + on_toolButton_Shift_clicked(); +} + void MainWindow::scaleMapView(int s) { editor->map->scale_exp += s; diff --git a/mainwindow.h b/mainwindow.h index 58380406..b020ee52 100755 --- a/mainwindow.h +++ b/mainwindow.h @@ -63,6 +63,12 @@ private slots: void on_actionZoom_In_triggered(); void on_actionZoom_Out_triggered(); void on_actionBetter_Cursors_triggered(); + void on_actionPencil_triggered(); + void on_actionPointer_triggered(); + void on_actionFlood_Fill_triggered(); + void on_actionEyedropper_triggered(); + void on_actionMove_triggered(); + void on_actionMap_Shift_triggered(); void on_toolButton_deleteObject_clicked(); void on_toolButton_Open_Scripts_clicked(); diff --git a/mainwindow.ui b/mainwindow.ui index 6b4ce23d..cde58531 100755 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -171,7 +171,7 @@ true - <html><head/><body><p>Editor</p><p><span style=" font-weight:600;">Click</span> and drag to draw on the map.</p><p><span style=" font-weight:600;">Right-click</span> and drag to select tiles.</p></body></html> + <html><head/><body><p>Pencil</p><p><span style=" font-weight:600;">Click</span> and drag to draw on the map.</p><p><span style=" font-weight:600;">Right-click</span> and drag to select tiles.</p></body></html> Paint @@ -214,7 +214,7 @@ - <html><head/><body><p>Flood Fill</p><p>Fills all similar tiles in a region with the selected metatiles or collision attributes</p></body></html> + <html><head/><body><p>Bucket Fill</p><p>Fills all similar tiles in a region with the selected metatiles or collision attributes</p></body></html> Fill @@ -231,7 +231,7 @@ - <html><head/><body><p>Eye Dropper</p><p><span style=" font-weight:600;">Click</span> to select a metatile or collision attribute.</p></body></html> + <html><head/><body><p>Eyedropper</p><p><span style=" font-weight:600;">Click</span> to select a metatile or collision attribute.</p></body></html> Dropper @@ -256,7 +256,7 @@ :/icons/move.ico:/icons/move.ico - + true @@ -378,7 +378,7 @@ 0 0 - 442 + 469 620 @@ -761,7 +761,7 @@ 0 0 - 302 + 275 86 @@ -867,7 +867,7 @@ 0 0 - 352 + 325 405 @@ -2128,9 +2128,21 @@ + + + Tools + + + + + + + + + @@ -2219,6 +2231,54 @@ <html><head/><body><p>Use reticule-styled cursors with icon showing currently selected tool.</p></body></html> + + + Pencil + + + N + + + + + Bucket Fill + + + B + + + + + Eyedropper + + + E + + + + + Move + + + M + + + + + Map Shift + + + S + + + + + Pointer + + + P + +