From a0f9e8f30ca32371030f180673f9e02657d972b3 Mon Sep 17 00:00:00 2001 From: Jayden Sipe Date: Sat, 22 Feb 2025 14:55:17 -0500 Subject: [PATCH] Add additional options to Action on Play and Stop --- editor/editor_node.cpp | 4 ++++ editor/editor_node.h | 2 ++ editor/editor_settings.cpp | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 84a4b42f536..c7f084af0fd 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4684,6 +4684,8 @@ void EditorNode::_project_run_started() { bottom_panel->make_item_visible(log); } else if (action_on_play == ACTION_ON_PLAY_OPEN_DEBUGGER) { bottom_panel->make_item_visible(EditorDebuggerNode::get_singleton()); + } else if (action_on_play == ACTION_ON_PLAY_CLOSE_BUTTOM_PANEL) { + bottom_panel->hide_bottom_panel(); } } @@ -4691,6 +4693,8 @@ void EditorNode::_project_run_stopped() { int action_on_stop = EDITOR_GET("run/bottom_panel/action_on_stop"); if (action_on_stop == ACTION_ON_STOP_CLOSE_BUTTOM_PANEL) { bottom_panel->hide_bottom_panel(); + } else if (action_on_stop == ACTION_ON_STOP_OPEN_OUTPUT) { + bottom_panel->make_item_visible(log); } } diff --git a/editor/editor_node.h b/editor/editor_node.h index 3ace2e868c5..5470008269b 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -127,10 +127,12 @@ public: ACTION_ON_PLAY_DO_NOTHING, ACTION_ON_PLAY_OPEN_OUTPUT, ACTION_ON_PLAY_OPEN_DEBUGGER, + ACTION_ON_PLAY_CLOSE_BUTTOM_PANEL, }; enum ActionOnStop { ACTION_ON_STOP_DO_NOTHING, + ACTION_ON_STOP_OPEN_OUTPUT, ACTION_ON_STOP_CLOSE_BUTTOM_PANEL, }; diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 7715956d095..61c7f3d4da1 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -958,8 +958,8 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { _initial_set("run/auto_save/save_before_running", true, true); // Bottom panel - EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "run/bottom_panel/action_on_play", EditorNode::ACTION_ON_PLAY_OPEN_OUTPUT, "Do Nothing,Open Output,Open Debugger") - EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "run/bottom_panel/action_on_stop", EditorNode::ACTION_ON_STOP_DO_NOTHING, "Do Nothing,Close Bottom Panel") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "run/bottom_panel/action_on_play", EditorNode::ACTION_ON_PLAY_OPEN_OUTPUT, "Do Nothing,Open Output,Open Debugger,Close Bottom Panel") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "run/bottom_panel/action_on_stop", EditorNode::ACTION_ON_STOP_DO_NOTHING, "Do Nothing,Open Output,Close Bottom Panel") // Output EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "run/output/font_size", 13, "8,48,1")