You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
Respect PROPERTY_USAGE_NEVER_DUPLICATE with Make Sub-Resources Unique
This commit is contained in:
@@ -125,17 +125,20 @@ void InspectorDock::_menu_option_confirm(int p_option, bool p_confirmed) {
|
||||
List<PropertyInfo> props;
|
||||
current->get_property_list(&props);
|
||||
|
||||
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
|
||||
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
|
||||
for (const PropertyInfo &property : props) {
|
||||
if (!(property.usage & PROPERTY_USAGE_STORAGE)) {
|
||||
continue;
|
||||
}
|
||||
if (property.usage & PROPERTY_USAGE_NEVER_DUPLICATE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Variant v = current->get(E->get().name);
|
||||
Variant v = current->get(property.name);
|
||||
Ref<RefCounted> ref = v;
|
||||
Ref<Resource> res = ref;
|
||||
if (v.is_ref_counted() && ref.is_valid() && res.is_valid()) {
|
||||
// Valid resource which would be duplicated if action is confirmed.
|
||||
resource_propnames.append(E->get().name);
|
||||
resource_propnames.append(property.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user