From 18f4f1794325622b741e4130951a9a51f7ad58ae Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 9 Apr 2025 14:25:15 -0500 Subject: [PATCH] +/- keyboard shortcuts for zoom --- src/scenedit/scen.actions.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/scenedit/scen.actions.cpp b/src/scenedit/scen.actions.cpp index 2df2324f..436087f8 100644 --- a/src/scenedit/scen.actions.cpp +++ b/src/scenedit/scen.actions.cpp @@ -1710,6 +1710,8 @@ void handle_keystroke(sf::Event event) { if(overall_mode >= MODE_MAIN_SCREEN) return; + // Shortcuts while terrain is visible: + for(short i = 0; i < 10; i++) if(chr2 == keypad[i] || (i % 2 == 0 && i > 0 && chr2 == arrows[i / 2 - 1])) { if(i == 0) { @@ -1816,6 +1818,16 @@ void handle_keystroke(sf::Event event) { overall_mode = MODE_EDIT_CREATURE; break; + case '+': case '=': // accept + with or without shift held for symmetry with - + cur_viewing_mode = std::max(cur_viewing_mode - 1, 0); + // Skip first line of fallthrough + if(false) + case '-': + cur_viewing_mode = std::min(cur_viewing_mode + 1, 3); + draw_main_screen(); + draw_terrain(); + break; + default: if(chr >= 'a' && chr <= 'z') { for(short i = 0; i < scenario.ter_types.size(); i++) {