Skip to content

Commit

Permalink
Merge pull request #87131 from KoBeWi/skyscrapper_selector_simulator
Browse files Browse the repository at this point in the history
Properly change GridMap floors while selecting
  • Loading branch information
akien-mga committed Jun 26, 2024
2 parents 783c99d + 80341da commit 36a5960
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions modules/gridmap/editor/grid_map_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,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:
Expand Down Expand Up @@ -754,19 +762,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;
}
}
}
}

Expand Down

0 comments on commit 36a5960

Please sign in to comment.