Fix param type button not updated when property is reset

This commit is contained in:
Serhii Snitsaruk 2023-12-10 15:50:03 +01:00
parent 949583a6b4
commit 2fc5732ed8
1 changed files with 7 additions and 4 deletions

View File

@ -219,10 +219,7 @@ void EditorPropertyBBParam::_mode_changed() {
void EditorPropertyBBParam::_type_selected(int p_index) { void EditorPropertyBBParam::_type_selected(int p_index) {
Ref<BBVariant> param = _get_edited_param(); Ref<BBVariant> param = _get_edited_param();
ERR_FAIL_COND(param.is_null()); ERR_FAIL_COND(param.is_null());
Variant::Type t = Variant::Type(p_index); param->set_type(Variant::Type(p_index));
param->set_type(t);
String type_name = Variant::get_type_name(t);
type_choice->set_icon(get_editor_theme_icon(type_name));
update_property(); update_property();
} }
@ -246,6 +243,12 @@ void EditorPropertyBBParam::update_property() {
mode_button->set_mode(Mode::SPECIFY_VALUE, true); mode_button->set_mode(Mode::SPECIFY_VALUE, true);
value_editor->update_property(); value_editor->update_property();
} }
if (param->is_class_ptr(BBVariant::get_class_ptr_static())) {
Variant::Type t = Variant::Type(param->get_type());
String type_name = Variant::get_type_name(t);
type_choice->set_icon(get_editor_theme_icon(type_name));
}
} }
void EditorPropertyBBParam::setup(PropertyHint p_hint, const String &p_hint_text) { void EditorPropertyBBParam::setup(PropertyHint p_hint, const String &p_hint_text) {