2
0
Эх сурвалжийг харах

Show enum property invalid value in inspector

kleonc 7 сар өмнө
parent
commit
03bc116f6d

+ 6 - 0
editor/editor_properties.cpp

@@ -321,6 +321,9 @@ void EditorPropertyTextEnum::update_property() {
 		}
 		}
 	} else {
 	} else {
 		option_button->select(default_option);
 		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();
 	Variant current = get_edited_property_value();
 	if (current.get_type() == Variant::NIL) {
 	if (current.get_type() == Variant::NIL) {
 		options->select(-1);
 		options->select(-1);
+		options->set_text("<null>");
 		return;
 		return;
 	}
 	}
 
 
@@ -709,6 +713,8 @@ void EditorPropertyEnum::update_property() {
 			return;
 			return;
 		}
 		}
 	}
 	}
+	options->select(-1);
+	options->set_text(itos(which));
 }
 }
 
 
 void EditorPropertyEnum::setup(const Vector<String> &p_options) {
 void EditorPropertyEnum::setup(const Vector<String> &p_options) {