From 2fc5732ed82ce5ea9ea7fbc0bfadaba495c0d328 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Sun, 10 Dec 2023 15:50:03 +0100 Subject: [PATCH] Fix param type button not updated when property is reset --- editor/editor_property_bb_param.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/editor/editor_property_bb_param.cpp b/editor/editor_property_bb_param.cpp index 6a66f04..4a6cfc8 100644 --- a/editor/editor_property_bb_param.cpp +++ b/editor/editor_property_bb_param.cpp @@ -219,10 +219,7 @@ void EditorPropertyBBParam::_mode_changed() { void EditorPropertyBBParam::_type_selected(int p_index) { Ref param = _get_edited_param(); ERR_FAIL_COND(param.is_null()); - Variant::Type t = 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)); + param->set_type(Variant::Type(p_index)); update_property(); } @@ -246,6 +243,12 @@ void EditorPropertyBBParam::update_property() { mode_button->set_mode(Mode::SPECIFY_VALUE, true); 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) {