diff options
author | Michael Alexsander <michaelalexsander@protonmail.com> | 2020-01-08 01:15:05 -0300 |
---|---|---|
committer | Michael Alexsander <michaelalexsander@protonmail.com> | 2020-01-08 02:02:34 -0300 |
commit | f9d11120f781512469718f51b628a79dc951b4c5 (patch) | |
tree | 8c3b2f1acc53559791d0882094680587ef439ef3 /editor | |
parent | 83fe471c3b3e62773438256a4ab01b83cf292c52 (diff) |
Minor fixes for ScriptCreateDialog
Diffstat (limited to 'editor')
-rw-r--r-- | editor/filesystem_dock.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/script_create_dialog.cpp | 13 | ||||
-rw-r--r-- | editor/script_create_dialog.h | 1 |
4 files changed, 9 insertions, 11 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 6b68d3f149..fb5c2b25c9 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1761,7 +1761,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected fpath = fpath.get_base_dir(); } make_script_dialog->config("Node", fpath.plus_file("new_script.gd"), false); - make_script_dialog->popup_centered(Size2(300, 300) * EDSCALE); + make_script_dialog->popup_centered(); } break; case FILE_COPY_PATH: { diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 335466b0c5..d0bd57d658 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1004,8 +1004,8 @@ void ScriptEditor::_menu_option(int p_option) { ScriptEditorBase *current = _get_current_editor(); switch (p_option) { case FILE_NEW: { - script_create_dialog->config("Node", "new_script"); - script_create_dialog->popup_centered(Size2(300, 300) * EDSCALE); + script_create_dialog->config("Node", "new_script", false); + script_create_dialog->popup_centered(); } break; case FILE_NEW_TEXTFILE: { file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index e1f9ed497c..25bc13033c 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -678,6 +678,11 @@ void ScriptCreateDialog::_update_dialog() { } } + if (!_can_be_built_in()) { + internal->set_pressed(false); + } + internal->set_disabled(!_can_be_built_in()); + /* Is Script created or loaded from existing file */ if (is_built_in) { @@ -685,8 +690,6 @@ void ScriptCreateDialog::_update_dialog() { parent_name->set_editable(true); parent_search_button->set_disabled(false); parent_browse_button->set_disabled(!can_inherit_from_file); - internal->set_visible(_can_be_built_in()); - internal_label->set_visible(_can_be_built_in()); _msg_path_valid(true, TTR("Built-in script (into scene file).")); } else if (is_new_script_created) { // New Script Created @@ -694,8 +697,6 @@ void ScriptCreateDialog::_update_dialog() { parent_name->set_editable(true); parent_search_button->set_disabled(false); parent_browse_button->set_disabled(!can_inherit_from_file); - internal->set_visible(_can_be_built_in()); - internal_label->set_visible(_can_be_built_in()); if (is_path_valid) { _msg_path_valid(true, TTR("Will create a new script file.")); } @@ -705,7 +706,6 @@ void ScriptCreateDialog::_update_dialog() { parent_name->set_editable(false); parent_search_button->set_disabled(true); parent_browse_button->set_disabled(true); - internal->set_disabled(!_can_be_built_in()); if (is_path_valid) { _msg_path_valid(true, TTR("Will load an existing script file.")); } @@ -834,8 +834,7 @@ ScriptCreateDialog::ScriptCreateDialog() { internal = memnew(CheckBox); internal->set_text(TTR("On")); internal->connect("pressed", this, "_built_in_pressed"); - internal_label = memnew(Label(TTR("Built-in Script:"))); - gc->add_child(internal_label); + gc->add_child(memnew(Label(TTR("Built-in Script:")))); gc->add_child(internal); /* Path */ diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h index 4d13bc9291..91d6315a78 100644 --- a/editor/script_create_dialog.h +++ b/editor/script_create_dialog.h @@ -58,7 +58,6 @@ class ScriptCreateDialog : public ConfirmationDialog { Button *path_button; EditorFileDialog *file_browse; CheckBox *internal; - Label *internal_label; VBoxContainer *path_vb; AcceptDialog *alert; CreateDialog *select_class; |