Improve documentation of some Resource methods

This commit is contained in:
Jordyfel
2025-02-06 22:16:18 +02:00
parent f0f5319b0b
commit e9703ee1aa
3 changed files with 14 additions and 14 deletions

View File

@@ -23,14 +23,14 @@
<method name="_reset_state" qualifiers="virtual">
<return type="void" />
<description>
For resources that use a variable number of properties, either via [method Object._validate_property] or [method Object._get_property_list], this method should be implemented to correctly clear the resource's state.
For resources that store state in non-exported properties, such as via [method Object._validate_property] or [method Object._get_property_list], this method must be implemented to clear them.
</description>
</method>
<method name="_set_path_cache" qualifiers="virtual const">
<return type="void" />
<param index="0" name="path" type="String" />
<description>
Sets the resource's path to [param path] without involving the resource cache.
Override this method to execute additional logic after [method set_path_cache] is called on this object.
</description>
</method>
<method name="_setup_local_to_scene" qualifiers="virtual">
@@ -85,7 +85,7 @@
<return type="String" />
<param index="0" name="path" type="String" />
<description>
Returns the unique identifier for the resource with the given [param path] from the resource cache. If the resource is not loaded and cached, an empty string is returned.
From the internal cache for scene-unique IDs, returns the ID of this resource for the scene at [param path]. If there is no entry, an empty string is returned. Useful to keep scene-unique IDs the same when implementing a VCS-friendly custom resource format by extending [ResourceFormatLoader] and [ResourceFormatSaver].
[b]Note:[/b] This method is only implemented when running in an editor context. At runtime, it returns an empty string.
</description>
</method>
@@ -104,13 +104,13 @@
<method name="is_built_in" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if the resource is built-in (from the engine) or [code]false[/code] if it is user-defined.
Returns [code]true[/code] if the resource is saved on disk as a part of another resource's file.
</description>
</method>
<method name="reset_state">
<return type="void" />
<description>
For resources that use a variable number of properties, either via [method Object._validate_property] or [method Object._get_property_list], override [method _reset_state] to correctly clear the resource's state.
Makes the resource clear its non-exported properties. See also [method _reset_state]. Useful when implementing a custom resource format by extending [ResourceFormatLoader] and [ResourceFormatSaver].
</description>
</method>
<method name="set_id_for_path">
@@ -118,7 +118,7 @@
<param index="0" name="path" type="String" />
<param index="1" name="id" type="String" />
<description>
Sets the unique identifier to [param id] for the resource with the given [param path] in the resource cache. If the unique identifier is empty, the cache entry using [param path] is removed if it exists.
In the internal cache for scene-unique IDs, sets the ID of this resource to [param id] for the scene at [param path]. If [param id] is empty, the cache entry for [param path] is cleared. Useful to keep scene-unique IDs the same when implementing a VCS-friendly custom resource format by extending [ResourceFormatLoader] and [ResourceFormatSaver].
[b]Note:[/b] This method is only implemented when running in an editor context.
</description>
</method>
@@ -126,7 +126,7 @@
<return type="void" />
<param index="0" name="path" type="String" />
<description>
Sets the resource's path to [param path] without involving the resource cache.
Sets the resource's path to [param path] without involving the resource cache. Useful for handling [enum ResourceFormatLoader.CacheMode] values when implementing a custom resource format by extending [ResourceFormatLoader] and [ResourceFormatSaver].
</description>
</method>
<method name="setup_local_to_scene" deprecated="This method should only be called internally.">