From 80341da660f822893595c46ac2744f31af4f94fe Mon Sep 17 00:00:00 2001 From: kobewi Date: Fri, 12 Jan 2024 22:14:25 +0100 Subject: [PATCH] Properly change GridMap floors while selecting --- .../gridmap/editor/grid_map_editor_plugin.cpp | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp index 225138dfb39..d0e0febdc3e 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.cpp +++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp @@ -60,10 +60,18 @@ void GridMapEditor::_menu_option(int p_option) { switch (p_option) { case MENU_OPTION_PREV_LEVEL: { floor->set_value(floor->get_value() - 1); + if (selection.active && input_action == INPUT_SELECT) { + selection.current[edit_axis]--; + _validate_selection(); + } } break; case MENU_OPTION_NEXT_LEVEL: { floor->set_value(floor->get_value() + 1); + if (selection.active && input_action == INPUT_SELECT) { + selection.current[edit_axis]++; + _validate_selection(); + } } break; case MENU_OPTION_X_AXIS: @@ -755,19 +763,6 @@ EditorPlugin::AfterGUIInput GridMapEditor::forward_spatial_input_event(Camera3D } } } - - if (k->is_shift_pressed() && selection.active && input_action != INPUT_PASTE) { - if (k->get_keycode() == (Key)options->get_popup()->get_item_accelerator(options->get_popup()->get_item_index(MENU_OPTION_PREV_LEVEL))) { - selection.click[edit_axis]--; - _validate_selection(); - return EditorPlugin::AFTER_GUI_INPUT_STOP; - } - if (k->get_keycode() == (Key)options->get_popup()->get_item_accelerator(options->get_popup()->get_item_index(MENU_OPTION_NEXT_LEVEL))) { - selection.click[edit_axis]++; - _validate_selection(); - return EditorPlugin::AFTER_GUI_INPUT_STOP; - } - } } }