From 516c218b9deb4cdcfa66c29fb0d2542a70381fe6 Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Sat, 29 Jun 2024 20:45:15 -0700 Subject: [PATCH] Add a boolean setting to show the 'arrange' button in the UI. --- src/common/settings.cpp | 1 + src/editor/graph/graph_edit.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 86e475ae..79148273 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -150,6 +150,7 @@ void OrchestratorSettings::_register_settings() _settings.emplace_back(BOOL_SETTING("ui/graph/disconnect_control_flow_when_dragged", true)); _settings.emplace_back(BOOL_SETTING("ui/graph/show_autowire_selection_dialog", true)); _settings.emplace_back(BOOL_SETTING("ui/graph/show_minimap", false)); + _settings.emplace_back(BOOL_SETTING("ui/graph/show_arrange_button", false)); _settings.emplace_back(BOOL_SETTING("ui/graph/show_overlay_action_tooltips", true)); _settings.emplace_back(COLOR_NO_ALPHA_SETTING("ui/graph/knot_selected_color", Color(0.68f, 0.44f, 0.09f))); diff --git a/src/editor/graph/graph_edit.cpp b/src/editor/graph/graph_edit.cpp index c2fec447..fe94069d 100644 --- a/src/editor/graph/graph_edit.cpp +++ b/src/editor/graph/graph_edit.cpp @@ -104,8 +104,8 @@ OrchestratorGraphEdit::OrchestratorGraphEdit(OrchestratorPlugin* p_plugin, const set_name(p_graph->get_graph_name()); set_minimap_enabled(OrchestratorSettings::get_singleton()->get_setting("ui/graph/show_minimap", false)); + set_show_arrange_button(OrchestratorSettings::get_singleton()->get_setting("ui/graph/show_arrange_button", false)); set_right_disconnects(true); - set_show_arrange_button(false); _plugin = p_plugin; _script_graph = p_graph; @@ -1661,6 +1661,7 @@ void OrchestratorGraphEdit::_on_project_settings_changed() bool node_resizable = os->get_setting("ui/nodes/resizable_by_default", false); set_minimap_enabled(os->get_setting("ui/graph/show_minimap", false)); + set_show_arrange_button(os->get_setting("ui/graph/show_arrange_button", false)); for_each_graph_node([&](OrchestratorGraphNode* node) { node->show_icons(show_icons);