From 606401331abb2d22bd3f238110ec2b1fef9e0df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Waldson=20Patr=C3=ADcio?= Date: Mon, 4 Dec 2017 16:48:46 -0300 Subject: [PATCH] Fix stop button always enabled (issue #13933) --- editor/editor_node.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 3513126a9b2..3bd10b88c49 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1614,7 +1614,6 @@ void EditorNode::_resource_selected(const RES &p_res, const String &p_property) void EditorNode::_run(bool p_current, const String &p_custom) { if (editor_run.get_status() == EditorRun::STATUS_PLAY) { - play_button->set_pressed(!_playing_edited); play_scene_button->set_pressed(_playing_edited); return; @@ -1746,6 +1745,7 @@ void EditorNode::_run(bool p_current, const String &p_custom) { play_button->set_pressed(true); play_button->set_icon(gui_base->get_icon("Reload", "EditorIcons")); } + stop_button->set_disabled(false); _playing_edited = p_current; } @@ -2199,6 +2199,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons")); play_custom_scene_button->set_pressed(false); play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom", "EditorIcons")); + stop_button->set_disabled(true); + if (bool(EDITOR_DEF("run/output/always_close_output_on_stop", true))) { for (int i = 0; i < bottom_panel_items.size(); i++) { if (bottom_panel_items[i].control == log) { @@ -5128,6 +5130,7 @@ EditorNode::EditorNode() { stop_button->set_icon(gui_base->get_icon("Stop", "EditorIcons")); stop_button->connect("pressed", this, "_menu_option", make_binds(RUN_STOP)); stop_button->set_tooltip(TTR("Stop the scene.")); + stop_button->set_disabled(true); stop_button->set_shortcut(ED_SHORTCUT("editor/stop", TTR("Stop"), KEY_F8)); run_native = memnew(EditorRunNative);