From 03bc116f6d208debb684251d0672656350083060 Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Wed, 12 Feb 2025 02:23:17 +0100 Subject: [PATCH] Show enum property invalid value in inspector --- editor/editor_properties.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 9ea0c2de9a7..52780d7c588 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -321,6 +321,9 @@ void EditorPropertyTextEnum::update_property() { } } else { option_button->select(default_option); + if (default_option < 0) { + option_button->set_text(current_value); + } } } @@ -699,6 +702,7 @@ void EditorPropertyEnum::update_property() { Variant current = get_edited_property_value(); if (current.get_type() == Variant::NIL) { options->select(-1); + options->set_text(""); return; } @@ -709,6 +713,8 @@ void EditorPropertyEnum::update_property() { return; } } + options->select(-1); + options->set_text(itos(which)); } void EditorPropertyEnum::setup(const Vector &p_options) {