Godot Engine – Multi-platform 2D and 3D game engine
Remove "Local Space" button from the tools group in the Game view
Michael Alexsander5d755e835167
diff --git a/editor/run/game_view_plugin.cpp b/editor/run/game_view_plugin.cppindex 3c528c02bc8..b801a434664 100644--- a/editor/run/game_view_plugin.cpp+++ b/editor/run/game_view_plugin.cpp@@ -754,7 +754,7 @@ void GameView::_update_debugger_buttons() {ci_button[i]->set_disabled(is_native);}}- ci_local_space->set_disabled(is_native);+ ci_local_space_button->set_disabled(is_native);menu = game_window_options_menu->get_popup();if (empty) {@@ -1677,15 +1677,18 @@ GameView::GameView(Ref<GameViewDebugger> p_debugger, EmbeddedProcessBase *p_embe// 2D Section- ci_bar = memnew(EditorToolbarGroup);+ ci_bar = memnew(HBoxContainer);main_menu_fc->add_child(ci_bar);ci_bar->hide();+ EditorToolbarGroup *ci_etg = memnew(EditorToolbarGroup);+ ci_bar->add_child(ci_etg);+ci_group.instantiate();{Button *button = _setup_button(SNAME("ToolSelect"), ci_group, ED_GET_SHORTCUT("canvas_item_editor/select_mode"));- ci_bar->get_hbox()->add_child(button);+ ci_etg->get_hbox()->add_child(button);button->set_pressed(true);button->connect(SceneStringName(pressed), callable_mp(*debugger, &GameViewDebugger::set_ci_tool).bind(CanvasItemManipulator::TOOL_SELECT));ci_button[CanvasItemManipulator::TOOL_SELECT] = button;@@ -1693,64 +1696,63 @@ GameView::GameView(Ref<GameViewDebugger> p_debugger, EmbeddedProcessBase *p_embeVSeparator *vsep = memnew(VSeparator);vsep->set_theme_type_variation("VSeparatorButtonGroup");- ci_bar->get_hbox()->add_child(vsep);+ ci_etg->get_hbox()->add_child(vsep);{Button *button = _setup_button(SNAME("ToolMove"), ci_group, ED_GET_SHORTCUT("canvas_item_editor/move_mode"));- ci_bar->get_hbox()->add_child(button);+ ci_etg->get_hbox()->add_child(button);button->connect(SceneStringName(pressed), callable_mp(*debugger, &GameViewDebugger::set_ci_tool).bind(CanvasItemManipulator::TOOL_MOVE));ci_button[CanvasItemManipulator::TOOL_MOVE] = button;}{Button *button = _setup_button(SNAME("ToolRotate"), ci_group, ED_GET_SHORTCUT("canvas_item_editor/rotate_mode"));- ci_bar->get_hbox()->add_child(button);+ ci_etg->get_hbox()->add_child(button);button->connect(SceneStringName(pressed), callable_mp(*debugger, &GameViewDebugger::set_ci_tool).bind(CanvasItemManipulator::TOOL_ROTATE));ci_button[CanvasItemManipulator::TOOL_ROTATE] = button;}{Button *button = _setup_button(SNAME("ToolScale"), ci_group, ED_GET_SHORTCUT("canvas_item_editor/scale_mode"));- ci_bar->get_hbox()->add_child(button);+ ci_etg->get_hbox()->add_child(button);button->connect(SceneStringName(pressed), callable_mp(*debugger, &GameViewDebugger::set_ci_tool).bind(CanvasItemManipulator::TOOL_SCALE));ci_button[CanvasItemManipulator::TOOL_SCALE] = button;}vsep = memnew(VSeparator);vsep->set_theme_type_variation("VSeparatorButtonGroup");- ci_bar->get_hbox()->add_child(vsep);+ ci_etg->get_hbox()->add_child(vsep);{Button *button = _setup_button(SNAME("ListSelect"), ci_group);- ci_bar->get_hbox()->add_child(button);+ ci_etg->get_hbox()->add_child(button);button->connect(SceneStringName(pressed), callable_mp(*debugger, &GameViewDebugger::set_ci_tool).bind(CanvasItemManipulator::TOOL_LIST_SELECT));ci_button[CanvasItemManipulator::TOOL_LIST_SELECT] = button;}{Button *button = _setup_button(SNAME("EditPivot"), ci_group);button->set_disabled(true);- ci_bar->get_hbox()->add_child(button);+ ci_etg->get_hbox()->add_child(button);button->connect(SceneStringName(pressed), callable_mp(*debugger, &GameViewDebugger::set_ci_tool).bind(CanvasItemManipulator::TOOL_EDIT_PIVOT));ci_button[CanvasItemManipulator::TOOL_EDIT_PIVOT] = button;}{Button *button = _setup_button(SNAME("ToolPan"), ci_group, ED_GET_SHORTCUT("canvas_item_editor/pan_mode"));- ci_bar->get_hbox()->add_child(button);+ ci_etg->get_hbox()->add_child(button);button->connect(SceneStringName(pressed), callable_mp(*debugger, &GameViewDebugger::set_ci_tool).bind(CanvasItemManipulator::TOOL_PAN));ci_button[CanvasItemManipulator::TOOL_PAN] = button;}vsep = memnew(VSeparator);- vsep->set_theme_type_variation("VSeparatorButtonGroup");- ci_bar->get_hbox()->add_child(vsep);-- ci_local_space = memnew(Button);- ci_bar->get_hbox()->add_child(ci_local_space);- ci_local_space->set_button_icon(EditorIconManager::get_icon(SNAME("Object")));- ci_local_space->set_toggle_mode(true);- ci_local_space->set_pressed(true);- ci_local_space->set_theme_type_variation(SceneStringName(FlatButton));- ci_local_space->connect(SceneStringName(toggled), callable_mp(*debugger, &GameViewDebugger::set_ci_local_space));- ci_local_space->set_shortcut(ED_GET_SHORTCUT("canvas_item_editor/use_local_space"));- ci_local_space->set_shortcut_context(this);+ ci_bar->add_child(vsep);++ ci_local_space_button = memnew(Button);+ ci_bar->add_child(ci_local_space_button);+ ci_local_space_button->set_button_icon(EditorIconManager::get_icon(SNAME("Object")));+ ci_local_space_button->set_toggle_mode(true);+ ci_local_space_button->set_pressed(true);+ ci_local_space_button->set_theme_type_variation(SceneStringName(FlatButton));+ ci_local_space_button->connect(SceneStringName(toggled), callable_mp(*debugger, &GameViewDebugger::set_ci_local_space));+ ci_local_space_button->set_shortcut(ED_GET_SHORTCUT("canvas_item_editor/use_local_space"));+ ci_local_space_button->set_shortcut_context(this);// 3D Sectiondiff --git a/editor/run/game_view_plugin.h b/editor/run/game_view_plugin.hindex 25f1c392470..e06d88092a3 100644--- a/editor/run/game_view_plugin.h+++ b/editor/run/game_view_plugin.h@@ -199,7 +199,7 @@ class GameView : public VBoxContainer {bool debug_hide_selection = false;bool debug_mute_audio = false;- EditorToolbarGroup *ci_bar = nullptr;+ HBoxContainer *ci_bar = nullptr;EditorToolbarGroup *n3d_bar = nullptr;bool selection_avoid_locked = false;@@ -215,7 +215,7 @@ class GameView : public VBoxContainer {Button *node_type_button[RuntimeNodeSelect::NODE_TYPE_MAX];// Not all CI tools have buttons, so make sure the gaps are at least initialized with null.Button *ci_button[CanvasItemManipulator::TOOL_MAX] = {};- Button *ci_local_space = nullptr;+ Button *ci_local_space_button = nullptr;Button *n3d_button[RuntimeNodeSelect::SELECT_MODE_MAX];MenuButton *n3d_options_menu = nullptr;