Skip to content

Commit 03bc116

Browse files
committed
Show enum property invalid value in inspector
1 parent 5da6dea commit 03bc116

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

editor/editor_properties.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ void EditorPropertyTextEnum::update_property() {
321321
}
322322
} else {
323323
option_button->select(default_option);
324+
if (default_option < 0) {
325+
option_button->set_text(current_value);
326+
}
324327
}
325328
}
326329

@@ -699,6 +702,7 @@ void EditorPropertyEnum::update_property() {
699702
Variant current = get_edited_property_value();
700703
if (current.get_type() == Variant::NIL) {
701704
options->select(-1);
705+
options->set_text("<null>");
702706
return;
703707
}
704708

@@ -709,6 +713,8 @@ void EditorPropertyEnum::update_property() {
709713
return;
710714
}
711715
}
716+
options->select(-1);
717+
options->set_text(itos(which));
712718
}
713719

714720
void EditorPropertyEnum::setup(const Vector<String> &p_options) {

0 commit comments

Comments
 (0)