diff options
-rw-r--r-- | editor/code_editor.cpp | 14 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 16 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.h | 1 | ||||
-rw-r--r-- | editor/project_export.cpp | 12 |
4 files changed, 34 insertions, 9 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index bf328e50e7..16f55312bb 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -105,6 +105,11 @@ void FindReplaceBar::_notification(int p_what) { hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size()); } else if (p_what == NOTIFICATION_THEME_CHANGED) { matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color("font_color", "Label") : get_theme_color("error_color", "Editor")); + } else if (p_what == NOTIFICATION_PREDELETE) { + if (base_text_editor) { + base_text_editor->remove_find_replace_bar(); + base_text_editor = nullptr; + } } } @@ -595,6 +600,10 @@ void FindReplaceBar::set_text_edit(CodeTextEditor *p_text_editor) { text_editor = nullptr; } + if (!p_text_editor) { + return; + } + results_count = -1; base_text_editor = p_text_editor; text_editor = base_text_editor->get_text_editor(); @@ -1667,6 +1676,11 @@ void CodeTextEditor::_notification(int p_what) { } set_process_input(is_visible_in_tree()); } break; + case NOTIFICATION_PREDELETE: { + if (find_replace_bar) { + find_replace_bar->set_text_edit(nullptr); + } + } break; default: break; } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 89b486c4df..498d5b0711 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -760,6 +760,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) { _update_members_overview_visibility(); _update_help_overview_visibility(); _save_layout(); + _update_find_replace_bar(); } void ScriptEditor::_close_current_tab(bool p_save) { @@ -829,6 +830,7 @@ void ScriptEditor::_close_all_tabs() { _close_current_tab(false); } + _update_find_replace_bar(); } void ScriptEditor::_ask_close_current_unsaved_tab(ScriptEditorBase *current) { @@ -1640,15 +1642,13 @@ void ScriptEditor::ensure_select_current() { ScriptEditorBase *se = _get_current_editor(); if (se) { se->enable_editor(); - se->set_find_replace_bar(find_replace_bar); if (!grab_focus_block && is_visible_in_tree()) { se->ensure_focus(); } - } else { - find_replace_bar->hide(); } } + _update_find_replace_bar(); _update_selected_editor_menu(); } @@ -2520,6 +2520,16 @@ void ScriptEditor::_file_removed(const String &p_removed_file) { } } +void ScriptEditor::_update_find_replace_bar() { + ScriptEditorBase *se = _get_current_editor(); + if (se) { + se->set_find_replace_bar(find_replace_bar); + } else { + find_replace_bar->set_text_edit(nullptr); + find_replace_bar->hide(); + } +} + void ScriptEditor::_autosave_scripts() { save_all_scripts(); } diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index a03a4b393b..72a649ffbf 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -328,6 +328,7 @@ class ScriptEditor : public PanelContainer { void _show_error_dialog(String p_path); void _close_tab(int p_idx, bool p_save = true, bool p_history_back = true); + void _update_find_replace_bar(); void _close_current_tab(bool p_save = true); void _close_discard_current_tab(const String &p_str); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index ec65694772..75736a0723 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -1110,9 +1110,9 @@ ProjectExportDialog::ProjectExportDialog() { exclude_filters->connect("text_changed", callable_mp(this, &ProjectExportDialog::_filter_changed)); script_mode = memnew(OptionButton); - resources_vb->add_margin_child(TTR("Script Export Mode:"), script_mode); + resources_vb->add_margin_child(TTR("GDScript Export Mode:"), script_mode); script_mode->add_item(TTR("Text"), (int)EditorExportPreset::MODE_SCRIPT_TEXT); - script_mode->add_item(TTR("Compiled"), (int)EditorExportPreset::MODE_SCRIPT_COMPILED); + script_mode->add_item(TTR("Compiled Bytecode (Faster Loading)"), (int)EditorExportPreset::MODE_SCRIPT_COMPILED); script_mode->connect("item_selected", callable_mp(this, &ProjectExportDialog::_script_export_mode_changed)); // Feature tags. @@ -1137,12 +1137,12 @@ ProjectExportDialog::ProjectExportDialog() { enc_pck = memnew(CheckButton); enc_pck->connect("toggled", callable_mp(this, &ProjectExportDialog::_enc_pck_changed)); - enc_pck->set_text(TTR("Encrypt exported PCK")); + enc_pck->set_text(TTR("Encrypt Exported PCK")); sec_vb->add_child(enc_pck); enc_directory = memnew(CheckButton); enc_directory->connect("toggled", callable_mp(this, &ProjectExportDialog::_enc_directory_changed)); - enc_directory->set_text("Encrypt index (file names and info)."); + enc_directory->set_text("Encrypt Index (File Names and Info)"); sec_vb->add_child(enc_directory); enc_in_filters = memnew(LineEdit); @@ -1160,9 +1160,9 @@ ProjectExportDialog::ProjectExportDialog() { script_key = memnew(LineEdit); script_key->connect("text_changed", callable_mp(this, &ProjectExportDialog::_script_encryption_key_changed)); script_key_error = memnew(Label); - script_key_error->set_text("- " + TTR("Invalid Encryption Key (must be 64 characters long)")); + script_key_error->set_text("- " + TTR("Invalid Encryption Key (must be 64 hexadecimal characters long)")); script_key_error->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("error_color", "Editor")); - sec_vb->add_margin_child(TTR("Encryption Key (256-bits as hex):"), script_key); + sec_vb->add_margin_child(TTR("Encryption Key (256-bits as hexadecimal):"), script_key); sec_vb->add_child(script_key_error); sections->add_child(sec_vb); |