diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/animation_track_editor.cpp | 6 | ||||
-rw-r--r-- | editor/animation_track_editor.h | 6 | ||||
-rw-r--r-- | editor/code_editor.cpp | 57 | ||||
-rw-r--r-- | editor/code_editor.h | 1 | ||||
-rw-r--r-- | editor/editor_node.cpp | 2 | ||||
-rw-r--r-- | editor/editor_node.h | 2 | ||||
-rw-r--r-- | editor/rename_dialog.cpp | 6 | ||||
-rw-r--r-- | editor/rename_dialog.h | 7 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 1 | ||||
-rw-r--r-- | editor/script_create_dialog.cpp | 4 | ||||
-rw-r--r-- | editor/script_create_dialog.h | 4 |
11 files changed, 70 insertions, 26 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index c835dda1b9..f5b5cfa848 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -5273,17 +5273,17 @@ AnimationTrackEditor::AnimationTrackEditor() { VBoxContainer *cleanup_vb = memnew(VBoxContainer); cleanup_dialog->add_child(cleanup_vb); - cleanup_keys = memnew(CheckButton); + cleanup_keys = memnew(CheckBox); cleanup_keys->set_text(TTR("Remove invalid keys")); cleanup_keys->set_pressed(true); cleanup_vb->add_child(cleanup_keys); - cleanup_tracks = memnew(CheckButton); + cleanup_tracks = memnew(CheckBox); cleanup_tracks->set_text(TTR("Remove unresolved and empty tracks")); cleanup_tracks->set_pressed(true); cleanup_vb->add_child(cleanup_tracks); - cleanup_all = memnew(CheckButton); + cleanup_all = memnew(CheckBox); cleanup_all->set_text(TTR("Clean-up all animations")); cleanup_vb->add_child(cleanup_all); diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index 0d5a621e07..8dc2304a95 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -439,9 +439,9 @@ class AnimationTrackEditor : public VBoxContainer { SpinBox *optimize_max_angle; ConfirmationDialog *cleanup_dialog; - CheckButton *cleanup_keys; - CheckButton *cleanup_tracks; - CheckButton *cleanup_all; + CheckBox *cleanup_keys; + CheckBox *cleanup_tracks; + CheckBox *cleanup_all; ConfirmationDialog *scale_dialog; SpinBox *scale; diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index d5aae7b562..7c396e1da3 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -341,7 +341,11 @@ bool FindReplaceBar::search_prev() { bool FindReplaceBar::search_next() { uint32_t flags = 0; - String text = get_search_text(); + String text; + if (replace_all_mode) + text = get_replace_text(); + else + text = get_search_text(); if (is_whole_words()) flags |= TextEdit::SEARCH_WHOLE_WORDS; @@ -734,15 +738,54 @@ void CodeTextEditor::_complete_request() { if (entries.size() == 0) return; - Vector<String> options; - options.resize(entries.size()); - size_t i = 0; for (List<ScriptCodeCompletionOption>::Element *E = entries.front(); E; E = E->next()) { - options.write[i] = E->get().insert_text; - i++; + E->get().icon = _get_completion_icon(E->get()); } + text_editor->code_complete(entries, forced); +} - text_editor->code_complete(options, forced); +Ref<Texture> CodeTextEditor::_get_completion_icon(const ScriptCodeCompletionOption &p_option) { + Ref<Texture> tex; + switch (p_option.kind) { + case ScriptCodeCompletionOption::KIND_CLASS: { + if (has_icon(p_option.display, "EditorIcons")) { + tex = get_icon(p_option.display, "EditorIcons"); + } else { + tex = get_icon("Object", "EditorIcons"); + } + } break; + case ScriptCodeCompletionOption::KIND_ENUM: + tex = get_icon("Enum", "EditorIcons"); + break; + case ScriptCodeCompletionOption::KIND_FILE_PATH: + tex = get_icon("File", "EditorIcons"); + break; + case ScriptCodeCompletionOption::KIND_NODE_PATH: + tex = get_icon("NodePath", "EditorIcons"); + break; + case ScriptCodeCompletionOption::KIND_VARIABLE: + tex = get_icon("Variant", "EditorIcons"); + break; + case ScriptCodeCompletionOption::KIND_CONSTANT: + tex = get_icon("MemberConstant", "EditorIcons"); + break; + case ScriptCodeCompletionOption::KIND_MEMBER: + tex = get_icon("MemberProperty", "EditorIcons"); + break; + case ScriptCodeCompletionOption::KIND_SIGNAL: + tex = get_icon("MemberSignal", "EditorIcons"); + break; + case ScriptCodeCompletionOption::KIND_FUNCTION: + tex = get_icon("MemberMethod", "EditorIcons"); + break; + case ScriptCodeCompletionOption::KIND_PLAIN_TEXT: + tex = get_icon("CubeMesh", "EditorIcons"); + break; + default: + tex = get_icon("String", "EditorIcons"); + break; + } + return tex; } void CodeTextEditor::_font_resize_timeout() { diff --git a/editor/code_editor.h b/editor/code_editor.h index 2653a8cecc..5af1f531a9 100644 --- a/editor/code_editor.h +++ b/editor/code_editor.h @@ -162,6 +162,7 @@ class CodeTextEditor : public VBoxContainer { void _update_font(); void _complete_request(); + Ref<Texture> _get_completion_icon(const ScriptCodeCompletionOption &p_option); void _font_resize_timeout(); bool _add_font_size(int p_delta); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 8bf328ecc2..9d3be1ab9e 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -6265,7 +6265,7 @@ EditorNode::EditorNode() { file_export_lib->set_title(TTR("Export Library")); file_export_lib->set_mode(EditorFileDialog::MODE_SAVE_FILE); file_export_lib->connect("file_selected", this, "_dialog_action"); - file_export_lib_merge = memnew(CheckButton); + file_export_lib_merge = memnew(CheckBox); file_export_lib_merge->set_text(TTR("Merge With Existing")); file_export_lib_merge->set_pressed(true); file_export_lib->get_vbox()->add_child(file_export_lib_merge); diff --git a/editor/editor_node.h b/editor/editor_node.h index ca64126c60..733f29c8ff 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -330,7 +330,7 @@ private: EditorFileDialog *file_export; EditorFileDialog *file_export_lib; EditorFileDialog *file_script; - CheckButton *file_export_lib_merge; + CheckBox *file_export_lib_merge; LineEdit *file_export_password; String current_path; MenuButton *update_spinner; diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index 40343cf908..cc9e14975f 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -131,7 +131,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und vbc_substitute->set_name(TTR("Substitute")); tabc_features->add_child(vbc_substitute); - cbut_substitute = memnew(CheckButton); + cbut_substitute = memnew(CheckBox); cbut_substitute->set_text(TTR("Substitute")); vbc_substitute->add_child(cbut_substitute); @@ -246,7 +246,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und vbc_regex->set_custom_minimum_size(Size2(0, feature_min_height)); tabc_features->add_child(vbc_regex); - cbut_regex = memnew(CheckButton); + cbut_regex = memnew(CheckBox); cbut_regex->set_text(TTR("Regular Expressions")); vbc_regex->add_child(cbut_regex); @@ -258,7 +258,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und vbc_process->set_custom_minimum_size(Size2(0, feature_min_height)); tabc_features->add_child(vbc_process); - cbut_process = memnew(CheckButton); + cbut_process = memnew(CheckBox); cbut_process->set_text(TTR("Post-Process")); vbc_process->add_child(cbut_process); diff --git a/editor/rename_dialog.h b/editor/rename_dialog.h index 4e0fab6a9f..9f0fbf66a1 100644 --- a/editor/rename_dialog.h +++ b/editor/rename_dialog.h @@ -32,7 +32,6 @@ #define RENAME_DIALOG_H #include "scene/gui/check_box.h" -#include "scene/gui/check_button.h" #include "scene/gui/dialogs.h" #include "scene/gui/option_button.h" #include "scene/gui/spin_box.h" @@ -75,9 +74,9 @@ class RenameDialog : public ConfirmationDialog { TabContainer *tabc_features; - CheckButton *cbut_substitute; - CheckButton *cbut_regex; - CheckButton *cbut_process; + CheckBox *cbut_substitute; + CheckBox *cbut_regex; + CheckBox *cbut_process; CheckBox *chk_per_level_counter; Button *but_insert_name; diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 442de08ffa..2458aa0759 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -439,6 +439,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } script_create_dialog->connect("script_created", this, "_script_created"); script_create_dialog->connect("popup_hide", this, "_script_creation_closed"); + script_create_dialog->set_inheritance_base_type("Node"); script_create_dialog->config(inherits, path); script_create_dialog->popup_centered(); diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 8916f4d8c4..bebfe6d3a1 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -742,8 +742,8 @@ ScriptCreateDialog::ScriptCreateDialog() { /* Built-in Script */ - internal = memnew(CheckButton); - internal->set_h_size_flags(0); + internal = memnew(CheckBox); + internal->set_text(TTR("On")); internal->connect("pressed", this, "_built_in_pressed"); internal_label = memnew(Label(TTR("Built-in Script"))); internal_label->set_align(Label::ALIGN_RIGHT); diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h index 61f87f5732..288b8f604b 100644 --- a/editor/script_create_dialog.h +++ b/editor/script_create_dialog.h @@ -33,7 +33,7 @@ #include "editor/editor_file_dialog.h" #include "editor/editor_settings.h" -#include "scene/gui/check_button.h" +#include "scene/gui/check_box.h" #include "scene/gui/dialogs.h" #include "scene/gui/grid_container.h" #include "scene/gui/line_edit.h" @@ -57,7 +57,7 @@ class ScriptCreateDialog : public ConfirmationDialog { LineEdit *file_path; Button *path_button; EditorFileDialog *file_browse; - CheckButton *internal; + CheckBox *internal; Label *internal_label; VBoxContainer *path_vb; AcceptDialog *alert; |