diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-04-21 15:23:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-21 15:23:35 +0200 |
commit | 79f82bd74284a3a90177d6446449d2a69285130f (patch) | |
tree | 8b20a991315c19c23a83b37eed22ac6ec0d34597 /editor/editor_help.cpp | |
parent | 1061cf9f6634601d7c2b17b81f8f4699ee71d670 (diff) | |
parent | 5d4dc2d45caef77cdb52e365bc02f64d54046df5 (diff) |
Merge pull request #38063 from reduz/implement-typed-arrays
Add ability to bind typed arrays to script API
Diffstat (limited to 'editor/editor_help.cpp')
-rw-r--r-- | editor/editor_help.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index a36e2f360e..bad70d9714 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -198,7 +198,12 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum) { const Color text_color = get_theme_color("default_color", "RichTextLabel"); const Color type_color = get_theme_color("accent_color", "Editor").linear_interpolate(text_color, 0.5); class_desc->push_color(type_color); + bool add_array = false; if (can_ref) { + if (t.ends_with("[]")) { + add_array = true; + t = t.replace("[]", ""); + } if (p_enum.empty()) { class_desc->push_meta("#" + t); //class } else { @@ -206,8 +211,15 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum) { } } class_desc->add_text(t); - if (can_ref) + if (can_ref) { class_desc->pop(); + if (add_array) { + class_desc->add_text(" "); + class_desc->push_meta("#Array"); //class + class_desc->add_text("[]"); + class_desc->pop(); + } + } class_desc->pop(); } |