From b0ceeb23415f2afbc94566aac29778ef5c8d1d8b Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Fri, 14 Jul 2023 14:25:26 +0800 Subject: [PATCH] Hide explicitly specified flag value in Inspector (cherry picked from commit de83b7166c280f92fd576622848ffbea22514fc4) --- editor/editor_properties.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 875351cacdf..77d6ec9ab22 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -772,7 +772,7 @@ void EditorPropertyFlags::setup(const Vector &p_options) { const int flag_index = flags.size(); // Index of the next element (added by the code below). // Value for a flag can be explicitly overridden. - Vector text_split = p_options[i].split(":"); + Vector text_split = option.split(":"); if (text_split.size() != 1) { current_val = text_split[1].to_int(); } else { @@ -782,7 +782,7 @@ void EditorPropertyFlags::setup(const Vector &p_options) { // Create a CheckBox for the current flag. CheckBox *cb = memnew(CheckBox); - cb->set_text(option); + cb->set_text(text_split[0]); cb->set_clip_text(true); cb->connect("pressed", callable_mp(this, &EditorPropertyFlags::_flag_toggled).bind(flag_index)); add_focusable(cb);