diff options
| author | Ninni Pipping <over999ships@gmail.com> | 2023-03-06 12:29:46 +0100 |
|---|---|---|
| committer | Yuri Sizov <yuris@humnom.net> | 2023-03-13 22:11:46 +0100 |
| commit | 75e078d88508bcfb139ccdc320e6a88b1a8e0cff (patch) | |
| tree | 48b79ae494f8c6d7b62183b2547ceeedbf51c680 | |
| parent | a755ac856adb8ad456a346c417c4c2f346107143 (diff) | |
Fix type icons in `PropertySelector`
And adding a check to prevent future issues.
(cherry picked from commit ca86d53e7f9c6f9785f5ef48917e92d41296f984)
| -rw-r--r-- | editor/property_selector.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index b756cdb8ed..ec323b5853 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -124,7 +124,7 @@ void PropertySelector::_update_search() { bool found = false; - Ref<Texture2D> type_icons[Variant::VARIANT_MAX] = { + Ref<Texture2D> type_icons[] = { search_options->get_theme_icon(SNAME("Variant"), SNAME("EditorIcons")), search_options->get_theme_icon(SNAME("bool"), SNAME("EditorIcons")), search_options->get_theme_icon(SNAME("int"), SNAME("EditorIcons")), @@ -137,11 +137,14 @@ void PropertySelector::_update_search() { search_options->get_theme_icon(SNAME("Vector3"), SNAME("EditorIcons")), search_options->get_theme_icon(SNAME("Vector3i"), SNAME("EditorIcons")), search_options->get_theme_icon(SNAME("Transform2D"), SNAME("EditorIcons")), + search_options->get_theme_icon(SNAME("Vector4"), SNAME("EditorIcons")), + search_options->get_theme_icon(SNAME("Vector4"), SNAME("EditorIcons")), // Vector4i, needs icon. search_options->get_theme_icon(SNAME("Plane"), SNAME("EditorIcons")), search_options->get_theme_icon(SNAME("Quaternion"), SNAME("EditorIcons")), search_options->get_theme_icon(SNAME("AABB"), SNAME("EditorIcons")), search_options->get_theme_icon(SNAME("Basis"), SNAME("EditorIcons")), search_options->get_theme_icon(SNAME("Transform3D"), SNAME("EditorIcons")), + search_options->get_theme_icon(SNAME("Variant"), SNAME("EditorIcons")), // Projection, needs icon. search_options->get_theme_icon(SNAME("Color"), SNAME("EditorIcons")), search_options->get_theme_icon(SNAME("StringName"), SNAME("EditorIcons")), search_options->get_theme_icon(SNAME("NodePath"), SNAME("EditorIcons")), @@ -161,6 +164,7 @@ void PropertySelector::_update_search() { search_options->get_theme_icon(SNAME("PackedVector3Array"), SNAME("EditorIcons")), search_options->get_theme_icon(SNAME("PackedColorArray"), SNAME("EditorIcons")) }; + static_assert((sizeof(type_icons) / sizeof(type_icons[0])) == Variant::VARIANT_MAX, "Number of type icons doesn't match the number of Variant types."); for (const PropertyInfo &E : props) { if (E.usage == PROPERTY_USAGE_CATEGORY) { |