From 3a4a6143d2ef070936183a30e5bad8c1ac3c9f10 Mon Sep 17 00:00:00 2001 From: titiger Date: Sun, 31 Jan 2016 02:25:24 +0100 Subject: [PATCH] fixed ctrl-s and maybe more menu shortcuts Beside of this I removed some never used complicated key shortcuts noone knows anyway. --- source/glest_map_editor/main.cpp | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/source/glest_map_editor/main.cpp b/source/glest_map_editor/main.cpp index cd59c1f7..ffbb01ba 100644 --- a/source/glest_map_editor/main.cpp +++ b/source/glest_map_editor/main.cpp @@ -1332,23 +1332,11 @@ void MainWindow::uncheckRadius() { return; } - if (currentBrush == btHeight || currentBrush == btGradient) { // 'height' brush - if (e.GetKeyCode() >= '0' && e.GetKeyCode() <= '5') { - height = e.GetKeyCode() - 48; // '0'-'5' == 0-5 - if (e.GetModifiers() == wxMOD_CONTROL) { // Ctrl means negative - height = -height ; - } - int id_offset = heightCount / 2 + height + 1; - if (currentBrush == btHeight) { - wxCommandEvent evt(wxEVT_NULL, miBrushHeight + id_offset); - onMenuBrushHeight(evt); - } else { - wxCommandEvent evt(wxEVT_NULL, miBrushGradient + id_offset); - onMenuBrushGradient(evt); - } - return; - } - } + if(e.GetModifiers() == wxMOD_CONTROL || e.GetModifiers() == wxMOD_ALT){ + e.Skip(); + } + // WARNING: don't add any Ctrl or ALt key shortcuts below those are reserved for internal menu use. + if (currentBrush == btSurface) { // surface texture if (e.GetKeyCode() >= '1' && e.GetKeyCode() <= '5') { surface = e.GetKeyCode() - 48; // '1'-'5' == 1-5 @@ -1432,9 +1420,6 @@ void MainWindow::uncheckRadius() { program->setUndoPoint(ctAll); program->shiftDown(); setDirty(); - } else if (e.GetKeyCode() == WXK_BACK && e.GetModifiers() == wxMOD_ALT) { // undo - wxCommandEvent evt(wxEVT_NULL, 0); - onMenuEditUndo(evt); } else { e.Skip(); }