diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-03-28 13:35:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-28 13:35:21 +0200 |
commit | 143d13717bcedd00b457958c563f0ab5d7c93896 (patch) | |
tree | d22b48fbffbf7bcbc2b66da3ae689ae0809d4aed /scene/gui | |
parent | 31f26f5c58f46c464653070fd1df4b57d0cd6d36 (diff) | |
parent | 360dea5348652d8806d33598e111651afb3d193a (diff) |
Merge pull request #59553 from reduz/script-extension-support
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/code_edit.cpp | 30 | ||||
-rw-r--r-- | scene/gui/code_edit.h | 8 | ||||
-rw-r--r-- | scene/gui/range.cpp | 2 |
3 files changed, 20 insertions, 20 deletions
diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index 3fa0cec302..e094c4546b 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -1782,10 +1782,10 @@ void CodeEdit::request_code_completion(bool p_force) { /* Don't re-query if all existing options are quoted types, eg path, signal. */ bool ignored = code_completion_active && !code_completion_options.is_empty(); if (ignored) { - ScriptCodeCompletionOption::Kind kind = ScriptCodeCompletionOption::KIND_PLAIN_TEXT; - const ScriptCodeCompletionOption *previous_option = nullptr; + ScriptLanguage::CodeCompletionKind kind = ScriptLanguage::CODE_COMPLETION_KIND_PLAIN_TEXT; + const ScriptLanguage::CodeCompletionOption *previous_option = nullptr; for (int i = 0; i < code_completion_options.size(); i++) { - const ScriptCodeCompletionOption ¤t_option = code_completion_options[i]; + const ScriptLanguage::CodeCompletionOption ¤t_option = code_completion_options[i]; if (!previous_option) { previous_option = ¤t_option; kind = current_option.kind; @@ -1795,7 +1795,7 @@ void CodeEdit::request_code_completion(bool p_force) { break; } } - ignored = ignored && (kind == ScriptCodeCompletionOption::KIND_FILE_PATH || kind == ScriptCodeCompletionOption::KIND_NODE_PATH || kind == ScriptCodeCompletionOption::KIND_SIGNAL); + ignored = ignored && (kind == ScriptLanguage::CODE_COMPLETION_KIND_FILE_PATH || kind == ScriptLanguage::CODE_COMPLETION_KIND_NODE_PATH || kind == ScriptLanguage::CODE_COMPLETION_KIND_SIGNAL); } if (ignored) { @@ -1818,8 +1818,8 @@ void CodeEdit::request_code_completion(bool p_force) { } void CodeEdit::add_code_completion_option(CodeCompletionKind p_type, const String &p_display_text, const String &p_insert_text, const Color &p_text_color, const RES &p_icon, const Variant &p_value) { - ScriptCodeCompletionOption completion_option; - completion_option.kind = (ScriptCodeCompletionOption::Kind)p_type; + ScriptLanguage::CodeCompletionOption completion_option; + completion_option.kind = (ScriptLanguage::CodeCompletionKind)p_type; completion_option.display = p_display_text; completion_option.insert_text = p_insert_text; completion_option.font_color = p_text_color; @@ -2702,7 +2702,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() { TypedArray<Dictionary> completion_options_sources; completion_options_sources.resize(code_completion_option_sources.size()); int i = 0; - for (const ScriptCodeCompletionOption &E : code_completion_option_sources) { + for (const ScriptLanguage::CodeCompletionOption &E : code_completion_option_sources) { Dictionary option; option["kind"] = E.kind; option["display_text"] = E.display; @@ -2727,8 +2727,8 @@ void CodeEdit::_filter_code_completion_candidates_impl() { /* Convert back into options. */ int max_width = 0; for (i = 0; i < completion_options.size(); i++) { - ScriptCodeCompletionOption option; - option.kind = (ScriptCodeCompletionOption::Kind)(int)completion_options[i].get("kind"); + ScriptLanguage::CodeCompletionOption option; + option.kind = (ScriptLanguage::CodeCompletionKind)(int)completion_options[i].get("kind"); option.display = completion_options[i].get("display_text"); option.insert_text = completion_options[i].get("insert_text"); option.font_color = completion_options[i].get("font_color"); @@ -2821,15 +2821,15 @@ void CodeEdit::_filter_code_completion_candidates_impl() { code_completion_options.clear(); code_completion_base = string_to_complete; - Vector<ScriptCodeCompletionOption> completion_options_casei; - Vector<ScriptCodeCompletionOption> completion_options_substr; - Vector<ScriptCodeCompletionOption> completion_options_substr_casei; - Vector<ScriptCodeCompletionOption> completion_options_subseq; - Vector<ScriptCodeCompletionOption> completion_options_subseq_casei; + Vector<ScriptLanguage::CodeCompletionOption> completion_options_casei; + Vector<ScriptLanguage::CodeCompletionOption> completion_options_substr; + Vector<ScriptLanguage::CodeCompletionOption> completion_options_substr_casei; + Vector<ScriptLanguage::CodeCompletionOption> completion_options_subseq; + Vector<ScriptLanguage::CodeCompletionOption> completion_options_subseq_casei; int max_width = 0; String string_to_complete_lower = string_to_complete.to_lower(); - for (ScriptCodeCompletionOption &option : code_completion_option_sources) { + for (ScriptLanguage::CodeCompletionOption &option : code_completion_option_sources) { if (single_quote && option.display.is_quoted()) { option.display = option.display.unquote().quote("'"); } diff --git a/scene/gui/code_edit.h b/scene/gui/code_edit.h index cb1309ced3..596a065f12 100644 --- a/scene/gui/code_edit.h +++ b/scene/gui/code_edit.h @@ -38,7 +38,7 @@ class CodeEdit : public TextEdit { public: /* Keep enum in sync with: */ - /* /core/object/script_language.h - ScriptCodeCompletionOption::Kind */ + /* /core/object/script_language.h - ScriptLanguage::CodeCompletionKind */ enum CodeCompletionKind { KIND_CLASS, KIND_FUNCTION, @@ -208,15 +208,15 @@ private: Color code_completion_existing_color = Color(0, 0, 0, 0); bool code_completion_active = false; - Vector<ScriptCodeCompletionOption> code_completion_options; + Vector<ScriptLanguage::CodeCompletionOption> code_completion_options; int code_completion_line_ofs = 0; int code_completion_current_selected = 0; int code_completion_longest_line = 0; Rect2i code_completion_rect; Set<char32_t> code_completion_prefixes; - List<ScriptCodeCompletionOption> code_completion_option_submitted; - List<ScriptCodeCompletionOption> code_completion_option_sources; + List<ScriptLanguage::CodeCompletionOption> code_completion_option_submitted; + List<ScriptLanguage::CodeCompletionOption> code_completion_option_sources; String code_completion_base; void _filter_code_completion_candidates_impl(); diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index 2fb6452a97..2eb41f1631 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -282,7 +282,7 @@ void Range::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "allow_greater"), "set_allow_greater", "is_greater_allowed"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "allow_lesser"), "set_allow_lesser", "is_lesser_allowed"); - GDVIRTUAL_BIND(_value_changed); + GDVIRTUAL_BIND(_value_changed, "new_value"); ADD_LINKED_PROPERTY("min_value", "value"); ADD_LINKED_PROPERTY("min_value", "max_value"); |