diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp index 7c30633702..b30c8ff9f7 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.cpp +++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp @@ -1227,6 +1227,7 @@ void GridMapEditor::_update_theme() { rotate_x_button->set_button_icon(get_theme_icon(SNAME("RotateLeft"), EditorStringName(EditorIcons))); rotate_y_button->set_button_icon(get_theme_icon(SNAME("ToolRotate"), EditorStringName(EditorIcons))); rotate_z_button->set_button_icon(get_theme_icon(SNAME("RotateRight"), EditorStringName(EditorIcons))); + clear_rotation_button->set_button_icon(get_theme_icon(SNAME("UndoRedo"), EditorStringName(EditorIcons))); mode_thumbnail->set_button_icon(get_theme_icon(SNAME("FileThumbnail"), EditorStringName(EditorIcons))); mode_list->set_button_icon(get_theme_icon(SNAME("FileList"), EditorStringName(EditorIcons))); options->set_button_icon(get_theme_icon(SNAME("Tools"), EditorStringName(EditorIcons))); @@ -1408,7 +1409,7 @@ GridMapEditor::GridMapEditor() { ED_SHORTCUT("grid_map/edit_y_axis", TTRC("Edit Y Axis"), KeyModifierMask::SHIFT + Key::X, true); ED_SHORTCUT("grid_map/edit_z_axis", TTRC("Edit Z Axis"), KeyModifierMask::SHIFT + Key::C, true); ED_SHORTCUT("grid_map/keep_selected", TTRC("Keep Selection")); - ED_SHORTCUT("grid_map/clear_rotation", TTRC("Clear Rotation")); + ED_SHORTCUT("grid_map/clear_rotation", TTRC("Clear Rotation"), KeyModifierMask::ALT | Key::G, true); options = memnew(MenuButton); options->set_theme_type_variation(SceneStringName(FlatButton)); @@ -1587,6 +1588,15 @@ GridMapEditor::GridMapEditor() { rotation_buttons->add_child(rotate_z_button); viewport_shortcut_buttons.push_back(rotate_z_button); + clear_rotation_button = memnew(Button); + clear_rotation_button->set_theme_type_variation(SceneStringName(FlatButton)); + clear_rotation_button->set_shortcut(ED_GET_SHORTCUT("grid_map/clear_rotation")); + clear_rotation_button->set_accessibility_name(TTRC("Cursor Reset Rotation")); + clear_rotation_button->connect(SceneStringName(pressed), + callable_mp(this, &GridMapEditor::_menu_option).bind(MENU_OPTION_CURSOR_CLEAR_ROTATION)); + rotation_buttons->add_child(clear_rotation_button); + viewport_shortcut_buttons.push_back(clear_rotation_button); + // Wide empty separation control. (like BoxContainer::add_spacer()) Control *c = memnew(Control); c->set_mouse_filter(MOUSE_FILTER_PASS); diff --git a/modules/gridmap/editor/grid_map_editor_plugin.h b/modules/gridmap/editor/grid_map_editor_plugin.h index cf40cd8a32..619a5cd3bb 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.h +++ b/modules/gridmap/editor/grid_map_editor_plugin.h @@ -92,6 +92,7 @@ class GridMapEditor : public EditorDock { Button *rotate_x_button = nullptr; Button *rotate_y_button = nullptr; Button *rotate_z_button = nullptr; + Button *clear_rotation_button = nullptr; EditorZoomWidget *zoom_widget = nullptr; Button *mode_thumbnail = nullptr;