Merge pull request #102499 from Jordyfel/resource-docs

Improve documentation of some `Resource` methods
This commit is contained in:
Rémi Verschelde
2025-06-28 13:02:54 +02:00
3 changed files with 14 additions and 14 deletions

View File

@ -671,7 +671,7 @@ void Resource::set_as_translation_remapped(bool p_remapped) {
}
}
//helps keep IDs same number when loading/saving scenes. -1 clears ID and it Returns -1 when no id stored
// Helps keep IDs the same when loading/saving scenes. An empty ID clears the entry, and an empty ID is returned when not found.
void Resource::set_id_for_path(const String &p_path, const String &p_id) {
#ifdef TOOLS_ENABLED
if (p_id.is_empty()) {

View File

@ -122,12 +122,12 @@ protected:
virtual Ref<Resource> _duplicate(const DuplicateParams &p_params) const;
public:
static Node *(*_get_local_scene_func)(); //used by editor
static void (*_update_configuration_warning)(); //used by editor
static Node *(*_get_local_scene_func)(); // Used by the editor.
static void (*_update_configuration_warning)(); // Used by the editor.
void update_configuration_warning();
virtual bool editor_can_reload_from_file();
virtual void reset_state(); //for resources that use variable amount of properties, either via _validate_property or _get_property_list, this function needs to be implemented to correctly clear state
virtual void reset_state(); // For resources that store state in non-exposed properties, such as via _validate_property or _get_property_list, this function must be implemented to clear them.
virtual Error copy_from(const Ref<Resource> &p_resource);
virtual void reload_from_file();
@ -178,9 +178,9 @@ public:
void set_as_translation_remapped(bool p_remapped);
virtual RID get_rid() const; // some resources may offer conversion to RID
virtual RID get_rid() const; // Some resources may offer conversion to RID.
//helps keep IDs same number when loading/saving scenes. -1 clears ID and it Returns -1 when no id stored
// Helps keep IDs the same when loading/saving scenes. An empty ID clears the entry, and an empty ID is returned when not found.
void set_id_for_path(const String &p_path, const String &p_id);
String get_id_for_path(const String &p_path) const;
@ -192,7 +192,7 @@ VARIANT_ENUM_CAST(Resource::DeepDuplicateMode);
class ResourceCache {
friend class Resource;
friend class ResourceLoader; //need the lock
friend class ResourceLoader; // Need the lock.
static Mutex lock;
static HashMap<String, Resource *> resources;
#ifdef TOOLS_ENABLED