From fb77cdf2f29c8fe5a75bc12a6c36c7eec192d64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 12 Sep 2018 12:29:50 +0200 Subject: Fix default script name in ScriptCreateDialog It would default either to '.gd' when created from the script editor, or to 'res:///NodeName.gd' (three '/') when created from the scene tree dock. --- editor/plugins/script_editor_plugin.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'editor/plugins/script_editor_plugin.cpp') diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 706bda4089..f25ca4786e 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -946,7 +946,7 @@ void ScriptEditor::_menu_option(int p_option) { switch (p_option) { case FILE_NEW: { - script_create_dialog->config("Node", ".gd"); + script_create_dialog->config("Node", "new_script"); script_create_dialog->popup_centered(Size2(300, 300) * EDSCALE); } break; case FILE_NEW_TEXTFILE: { @@ -1749,7 +1749,7 @@ void ScriptEditor::_update_script_names() { } break; case DISPLAY_DIR_AND_NAME: { if (!path.get_base_dir().get_file().empty()) { - sd.name = path.get_base_dir().get_file() + "/" + name; + sd.name = path.get_base_dir().get_file().plus_file(name); } else { sd.name = name; } @@ -2114,8 +2114,6 @@ void ScriptEditor::_editor_play() { debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_STEP), true); debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_BREAK), false); debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_CONTINUE), true); - - //debugger_gui->start_listening(Globals::get_singleton()->get("debug/debug_port")); } void ScriptEditor::_editor_pause() { -- cgit v1.2.3