1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +00:00

replay on play if already playing for scene and main + switch icon to reload if running.

This commit is contained in:
Alexander Holland
2015-10-28 23:50:11 +01:00
parent bd736e5af2
commit 65258f741b

View File

@@ -1740,8 +1740,10 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
} }
play_button->set_pressed(false); play_button->set_pressed(false);
play_button->set_icon(gui_base->get_icon("Play","EditorIcons"));
//pause_button->set_pressed(false); //pause_button->set_pressed(false);
play_scene_button->set_pressed(false); play_scene_button->set_pressed(false);
play_scene_button->set_icon(gui_base->get_icon("PlayScene","EditorIcons"));
String current_filename; String current_filename;
String run_filename; String run_filename;
@@ -1859,8 +1861,10 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
emit_signal("play_pressed"); emit_signal("play_pressed");
if (p_current) { if (p_current) {
play_scene_button->set_pressed(true); play_scene_button->set_pressed(true);
play_scene_button->set_icon(gui_base->get_icon("Reload","EditorIcons"));
} else { } else {
play_button->set_pressed(true); play_button->set_pressed(true);
play_button->set_icon(gui_base->get_icon("Reload","EditorIcons"));
} }
_playing_edited=p_current; _playing_edited=p_current;
@@ -2577,12 +2581,12 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
call_dialog->popup_centered_ratio(); call_dialog->popup_centered_ratio();
} break; } break;
case RUN_PLAY: { case RUN_PLAY: {
_menu_option_confirm(RUN_STOP,true);
_run(false); _run(false);
} break; } break;
case RUN_PLAY_CUSTOM_SCENE: { case RUN_PLAY_CUSTOM_SCENE: {
_menu_option_confirm(RUN_STOP,true);
quick_run->popup("PackedScene",true); quick_run->popup("PackedScene",true);
quick_run->set_title("Quick Run Scene.."); quick_run->set_title("Quick Run Scene..");
@@ -2599,18 +2603,20 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
editor_run.stop(); editor_run.stop();
play_button->set_pressed(false); play_button->set_pressed(false);
play_button->set_icon(gui_base->get_icon("Play","EditorIcons"));
play_scene_button->set_pressed(false); play_scene_button->set_pressed(false);
play_scene_button->set_icon(gui_base->get_icon("PlayScene","EditorIcons"));
//pause_button->set_pressed(false); //pause_button->set_pressed(false);
emit_signal("stop_pressed"); emit_signal("stop_pressed");
} break; } break;
case RUN_PLAY_SCENE: { case RUN_PLAY_SCENE: {
_menu_option_confirm(RUN_STOP,true);
_run(true); _run(true);
} break; } break;
case RUN_PLAY_NATIVE: { case RUN_PLAY_NATIVE: {
_menu_option_confirm(RUN_STOP,true);
emit_signal("play_pressed"); emit_signal("play_pressed");
editor_run.run_native_notify(); editor_run.run_native_notify();