1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-02 16:48:55 +00:00

Always enable Make Unique for previewed overrides

This commit is contained in:
kobewi
2025-11-23 12:35:21 +01:00
parent 235a32ad11
commit 11e97cace5
3 changed files with 7 additions and 0 deletions

View File

@@ -3577,6 +3577,8 @@ void EditorPropertyResource::update_property() {
}
resource_picker->set_edited_resource_no_check(res);
const Ref<Resource> &real_res = get_edited_property_value();
resource_picker->set_force_allow_unique(real_res.is_null() && res.is_valid());
}
void EditorPropertyResource::collapse_all_folding() {

View File

@@ -1369,6 +1369,9 @@ void EditorResourcePicker::_duplicate_selected_resources() {
}
bool EditorResourcePicker::_is_uniqueness_enabled(bool p_check_recursive) {
if (force_allow_unique) {
return true;
}
Ref<Resource> parent_resource = _has_parent_resource();
EditorNode *en = EditorNode::get_singleton();
bool internal_to_scene = en->is_resource_internal_to_scene(edited_resource);

View File

@@ -49,6 +49,7 @@ class EditorResourcePicker : public HBoxContainer {
bool editable = true;
bool dropping = false;
bool force_allow_unique = false;
Vector<String> inheritors_array;
mutable HashSet<StringName> allowed_types_without_convert;
@@ -142,6 +143,7 @@ public:
void set_edited_resource(Ref<Resource> p_resource);
void set_edited_resource_no_check(Ref<Resource> p_resource);
Ref<Resource> get_edited_resource();
void set_force_allow_unique(bool p_force) { force_allow_unique = p_force; }
void set_toggle_mode(bool p_enable);
bool is_toggle_mode() const;