Repository: godotengine/godot
File: editor/inspector/editor_resource_picker.cpp (C++)

Code before:
		preview_rect->set_texture(Ref<Texture2D>());

		assign_button->set_custom_minimum_size(assign_button_min_size);
		if (edited_resource == Ref<Resource>()) {
			assign_button->set_button_icon(Ref<Texture2D>());
			assign_button->set_text(TTR("<empty>"));
			assign_button->set_tooltip_text("");
			make_unique_button->set_disabled(true);
			make_unique_button->set_visible(false);
		} else {
			Ref<Resource> parent_res = _has_parent_resource();
			bool unique_enable = _is_uniqueness_enabled();
			bool unique_recursive_enabled = _is_uniqueness_enabled(true);
			bool is_internal = EditorNode::get_singleton()->is_resource_internal_to_scene(edited_resource);
			int num_of_copies = EditorNode::get_singleton()->get_resource_count(edited_resource);
			make_unique_button->set_button_icon(get_editor_theme_icon(SNAME("Instance")));
			make_unique_button->set_visible((num_of_copies > 1 || !is_internal) && !Object::cast_to<Script>(edited_resource.ptr()));
			make_unique_button->set_disabled((!unique_enable && !unique_recursive_enabled) || !editable);

			String tooltip;

			String resource_name = "resource";
			if (edited_resource.is_valid()) {
				resource_name = edited_resource->get_class();

				if (edited_resource->has_meta(SceneStringNames::get_singleton()->_custom_type_script)) {
					if (const Ref<Script> custom_script = PropertyUtils::get_custom_type_script(edited_resource.ptr()); custom_script.is_valid()) {
						if (const String global_name = custom_script->get_global_name(); !global_name.is_empty()) {
							resource_name = global_name;
						}
					}
				}
			}

			if (num_of_copies > 1) {
				tooltip = vformat(TTRN("This %s is used in %d place.", "This %s is used in %d places.", num_of_copies), resource_name, num_of_copies);
			} else if (!is_internal) {
				tooltip = vformat(TTR("This %s is external to scene."), resource_name);
			}

			if (!editable) {
				tooltip += "\n" + vformat(TTR("The %s cannot be edited in the inspector and can't be made unique directly."), resource_name) + "\n";
			} else {
				if (unique_enable) {
					tooltip += "\n" + TTR("Left-click to make it unique.") + "\n";
				}

				if (unique_recursive_enabled) {
					tooltip += TTR("It is possible to make its subresources unique.") + "\n" + TTR("Right-click to make them unique.");
				}


Review comment (suggestion):
```suggestion
				if (edited_resource->has_meta(SceneStringName(_custom_type_script))) {
```

Code after:
		preview_rect->set_texture(Ref<Texture2D>());

		assign_button->set_custom_minimum_size(assign_button_min_size);
		if (edited_resource == Ref<Resource>()) {
			assign_button->set_button_icon(Ref<Texture2D>());
			assign_button->set_text(TTR("<empty>"));
			assign_button->set_tooltip_text("");
			make_unique_button->set_disabled(true);
			make_unique_button->set_visible(false);
		} else {
			Ref<Resource> parent_res = _has_parent_resource();
			bool unique_enable = _is_uniqueness_enabled();
			bool unique_recursive_enabled = _is_uniqueness_enabled(true);
			bool is_internal = EditorNode::get_singleton()->is_resource_internal_to_scene(edited_resource);
			int num_of_copies = EditorNode::get_singleton()->get_resource_count(edited_resource);
			make_unique_button->set_button_icon(get_editor_theme_icon(SNAME("Instance")));
			make_unique_button->set_visible((num_of_copies > 1 || !is_internal) && !Object::cast_to<Script>(edited_resource.ptr()));
			make_unique_button->set_disabled((!unique_enable && !unique_recursive_enabled) || !editable);

			String tooltip;

			String resource_name = "resource";
			if (edited_resource.is_valid()) {
				resource_name = edited_resource->get_class();

				if (edited_resource->has_meta(SceneStringName(_custom_type_script))) {
					const Ref<Script> custom_script = PropertyUtils::get_custom_type_script(edited_resource.ptr());
					if (custom_script.is_valid()) {
						const String global_name = custom_script->get_global_name();
						if (!global_name.is_empty()) {
							resource_name = global_name;
						}
					}
				}
			}

			if (num_of_copies > 1) {
				tooltip = vformat(TTRN("This %s is used in %d place.", "This %s is used in %d places.", num_of_copies), resource_name, num_of_copies);
			} else if (!is_internal) {
				tooltip = vformat(TTR("This %s is external to scene."), resource_name);
			}

			if (!editable) {
				tooltip += "\n" + vformat(TTR("The %s cannot be edited in the inspector and can't be made unique directly."), resource_name) + "\n";
			} else {
				if (unique_enable) {
					tooltip += "\n" + TTR("Left-click to make it unique.") + "\n";
				}

				if (unique_recursive_enabled) {
					tooltip += TTR("It is possible to make its subresources unique.") + "\n" + TTR("Right-click to make them unique.");