Properly change GridMap floors while selecting

This commit is contained in:
kobewi 2024-01-12 22:14:25 +01:00
parent 26b1fd0d84
commit 80341da660
1 changed files with 8 additions and 13 deletions

View File

@ -60,10 +60,18 @@ void GridMapEditor::_menu_option(int p_option) {
switch (p_option) { switch (p_option) {
case MENU_OPTION_PREV_LEVEL: { case MENU_OPTION_PREV_LEVEL: {
floor->set_value(floor->get_value() - 1); floor->set_value(floor->get_value() - 1);
if (selection.active && input_action == INPUT_SELECT) {
selection.current[edit_axis]--;
_validate_selection();
}
} break; } break;
case MENU_OPTION_NEXT_LEVEL: { case MENU_OPTION_NEXT_LEVEL: {
floor->set_value(floor->get_value() + 1); floor->set_value(floor->get_value() + 1);
if (selection.active && input_action == INPUT_SELECT) {
selection.current[edit_axis]++;
_validate_selection();
}
} break; } break;
case MENU_OPTION_X_AXIS: 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;
}
}
} }
} }