From 609b8a2efcc8bfabca1ac8b13b0f67e7dfc9a3fc Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sun, 18 May 2025 18:45:21 -0500 Subject: [PATCH] editor escape key turn off tool / close terrain view --- src/scenedit/scen.actions.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/scenedit/scen.actions.cpp b/src/scenedit/scen.actions.cpp index 0b745e25..0e18a9a7 100644 --- a/src/scenedit/scen.actions.cpp +++ b/src/scenedit/scen.actions.cpp @@ -1745,7 +1745,19 @@ void handle_keystroke(sf::Event event) { return; } } - + + if(event.key.code == Key::Escape){ + if(overall_mode == MODE_DRAWING){ + // Not doing anything special. back to menu + handle_lb_action(NLS - 2); + }else{ + // Using a tool. Turn it off + set_string("Drawing mode",scenario.ter_types[current_terrain_type].name); + overall_mode = MODE_DRAWING; + } + return; + } + store_ter = current_terrain_type; chr = keyToChar(chr2, event.key.shift);