Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor Array subhints fix #32871

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions editor/array_property_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,14 @@ void ArrayPropertyEdit::edit(Object *p_obj, const StringName &p_prop, const Stri
if (!p_hint_string.empty()) {
int hint_subtype_seperator = p_hint_string.find(":");
if (hint_subtype_seperator >= 0) {
String subtype_string = p_hint_string.substr(0, hint_subtype_seperator);

int slash_pos = subtype_string.find("/");
String sub_str = p_hint_string.substr(0, hint_subtype_seperator);
subtype = Variant::Type(sub_str.to_int());
sub_str = p_hint_string.substr(hint_subtype_seperator + 1);
int slash_pos = sub_str.find("/");
if (slash_pos >= 0) {
subtype_hint = PropertyHint(subtype_string.substr(slash_pos + 1, subtype_string.size() - slash_pos - 1).to_int());
subtype_string = subtype_string.substr(0, slash_pos);
subtype_hint = PropertyHint(sub_str.substr(0, slash_pos).to_int());
subtype_hint_string = sub_str.substr(slash_pos + 1);
}

subtype_hint_string = p_hint_string.substr(hint_subtype_seperator + 1, p_hint_string.size() - hint_subtype_seperator - 1);
subtype = Variant::Type(subtype_string.to_int());
}
}
}
Expand Down
13 changes: 6 additions & 7 deletions editor/editor_properties_array_dict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,15 +477,14 @@ void EditorPropertyArray::setup(Variant::Type p_array_type, const String &p_hint
if (array_type == Variant::ARRAY && !p_hint_string.empty()) {
int hint_subtype_seperator = p_hint_string.find(":");
if (hint_subtype_seperator >= 0) {
String subtype_string = p_hint_string.substr(0, hint_subtype_seperator);
int slash_pos = subtype_string.find("/");
String sub_str = p_hint_string.substr(0, hint_subtype_seperator);
subtype = Variant::Type(sub_str.to_int());
sub_str = p_hint_string.substr(hint_subtype_seperator + 1);
int slash_pos = sub_str.find("/");
if (slash_pos >= 0) {
subtype_hint = PropertyHint(subtype_string.substr(slash_pos + 1, subtype_string.size() - slash_pos - 1).to_int());
subtype_string = subtype_string.substr(0, slash_pos);
subtype_hint = PropertyHint(sub_str.substr(0, slash_pos).to_int());
subtype_hint_string = sub_str.substr(slash_pos + 1);
}

subtype_hint_string = p_hint_string.substr(hint_subtype_seperator + 1, p_hint_string.size() - hint_subtype_seperator - 1);
subtype = Variant::Type(subtype_string.to_int());
}
}
}
Expand Down