From 67dfbc0816872a8048139a06cb0f6c37a749f1b0 Mon Sep 17 00:00:00 2001 From: Robert Yevdokimov <105675984+ryevdokimov@users.noreply.github.com> Date: Tue, 27 Aug 2024 19:16:43 -0400 Subject: [PATCH] Save the state of view transform gizmo option --- editor/plugins/node_3d_editor_plugin.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index c58109427b2..008b1295ceb 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -4058,6 +4058,14 @@ void Node3DEditorViewport::set_state(const Dictionary &p_state) { _menu_option(VIEW_GIZMOS); } } + if (p_state.has("transform_gizmo")) { + bool transform_gizmo = p_state["transform_gizmo"]; + + int idx = view_menu->get_popup()->get_item_index(VIEW_TRANSFORM_GIZMO); + if (view_menu->get_popup()->is_item_checked(idx) != transform_gizmo) { + _menu_option(VIEW_TRANSFORM_GIZMO); + } + } if (p_state.has("grid")) { bool grid = p_state["grid"]; @@ -4144,6 +4152,7 @@ Dictionary Node3DEditorViewport::get_state() const { d["listener"] = viewport->is_audio_listener_3d(); d["doppler"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_AUDIO_DOPPLER)); d["gizmos"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_GIZMOS)); + d["transform_gizmo"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_TRANSFORM_GIZMO)); d["grid"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_GRID)); d["information"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_INFORMATION)); d["frame_time"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_FRAME_TIME));