Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Add links back by using the correct syntax

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
  • Loading branch information
betalars and AThousandShips authored Oct 14, 2024
1 parent a7259ec commit f629da1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions doc/classes/ResourceLoader.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
The [param cache_mode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details.
Returns an empty resource if no [ResourceFormatLoader] could handle the file, and prints an error if no file is found at the specified path.
GDScript has a simplified [method @GDScript.load] built-in method which can be used in most situations, leaving the use of [ResourceLoader] for more advanced scenarios.
[b]Warning:[/b] Do not use this for save files, as it may lead to remote code execution when users share saves. You should only use this to load files that you know are trusted. Read the "Saving Games" tutorial for further guidance.
[b]Warning:[/b] Do not use this for save files, as it may lead to remote code execution when users share saves. You should only use this to load files that you know are trusted. See the [url=$DOCS_URL/tutorials/io/saving_games.html] "Saving Games" tutorial[/url] for more info.
[b]Note:[/b] If [member ProjectSettings.editor/export/convert_text_resources_to_binary] is [code]true[/code], [method @GDScript.load] will not be able to read converted files in an exported project. If you rely on run-time loading of files present within the PCK, set [member ProjectSettings.editor/export/convert_text_resources_to_binary] to [code]false[/code].
[b]Note:[/b] Relative paths will be prefixed with [code]"res://"[/code] before loading, to avoid unexpected results make sure your paths are absolute.
</description>
Expand All @@ -107,7 +107,7 @@
<description>
Returns the status of a threaded loading operation started with [method load_threaded_request] for the resource at [param path]. See [enum ThreadLoadStatus] for possible return values.
An array variable can optionally be passed via [param progress], and will return a one-element array containing the percentage of completion of the threaded loading.
[b]Warning:[/b] Do not use this for save files, as it may lead to remote code execution when users share saves. You should only use this to load files that you know are trusted. Read the "Saving Games" tutorial for further guidance.
[b]Warning:[/b] Do not use this for save files, as it may lead to remote code execution when users share saves. You should only use this to load files that you know are trusted. See the [url=$DOCS_URL/tutorials/io/saving_games.html] "Saving Games" tutorial[/url] for more info.
[b]Note:[/b] The recommended way of using this method is to call it during different frames (e.g., in [method Node._process], instead of a loop).
</description>
</method>
Expand All @@ -120,7 +120,7 @@
<description>
Loads the resource using threads. If [param use_sub_threads] is [code]true[/code], multiple threads will be used to load the resource, which makes loading faster, but may affect the main thread (and thus cause game slowdowns).
The [param cache_mode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details.
[b]Warning:[/b] Do not use this for save files, as it may lead to remote code execution when users share saves. You should only use this to load files that you know are trusted. Read the "Saving Games" tutorial for further guidance.
[b]Warning:[/b] Do not use this for save files, as it may lead to remote code execution when users share saves. You should only use this to load files that you know are trusted. See the [url=$DOCS_URL/tutorials/io/saving_games.html] "Saving Games" tutorial[/url] for more info.
</description>
</method>
<method name="remove_resource_format_loader">
Expand Down
2 changes: 1 addition & 1 deletion modules/gdscript/doc_classes/@GDScript.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
[/codeblock]
[b]Important:[/b] Relative paths are [i]not[/i] relative to the script calling this method, instead it is prefixed with [code]"res://"[/code]. Loading from relative paths might not work as expected.
This function is a simplified version of [method ResourceLoader.load], which can be used for more advanced scenarios.
[b]Warning:[/b] Do not use this for save files, as it may lead to remote code execution when users share saves. You should only use this to load files that you know are trusted. [b]Warning:[/b] Do not use this for save files, as it may lead to remote code execution when users share saves. You should only use this to load files that you know are trusted. Read the "Saving Games" tutorial for further guidance.
[b]Warning:[/b] Do not use this for save files, as it may lead to remote code execution when users share saves. You should only use this to load files that you know are trusted. See the [url=$DOCS_URL/tutorials/io/saving_games.html] "Saving Games" tutorial[/url] for more info.
[b]Note:[/b] Files have to be imported into the engine first to load them using this function. If you want to load [Image]s at run-time, you may use [method Image.load]. If you want to import audio files, you can use the snippet described in [member AudioStreamMP3.data].
[b]Note:[/b] If [member ProjectSettings.editor/export/convert_text_resources_to_binary] is [code]true[/code], [method @GDScript.load] will not be able to read converted files in an exported project. If you rely on run-time loading of files present within the PCK, set [member ProjectSettings.editor/export/convert_text_resources_to_binary] to [code]false[/code].
</description>
Expand Down

0 comments on commit f629da1

Please sign in to comment.