From 0a4067bdbf5ae51519853b85c0b47715cd8a1cb5 Mon Sep 17 00:00:00 2001 From: kobewi Date: Mon, 10 Jul 2023 23:23:51 +0200 Subject: [PATCH] Clarify return value of get_dependencies() (cherry picked from commit f567af413a828be9835998cf09097120947a560f) --- CHANGELOG.md | 1 + doc/classes/ResourceLoader.xml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2102b1d3e1..75b5fb4a9db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -319,6 +319,7 @@ See the [release announcement](https://godotengine.org/article/godot-4-1-is-here #### Core +- The strings returned by `ResourceLoader::get_dependencies()` now include paths in addition to UIDs ([GH-73131](https://github.com/godotengine/godot/pull/73131)). - Optimize Node children management ([GH-75627](https://github.com/godotengine/godot/pull/75627)). - Deprecate `NOTIFICATION_MOVED_IN_PARENT` for `NOTIFICATION_CHILD_ORDER_CHANGED` ([GH-75701](https://github.com/godotengine/godot/pull/75701)). - Optimize `Node::add_child` validation ([GH-75760](https://github.com/godotengine/godot/pull/75760)). diff --git a/doc/classes/ResourceLoader.xml b/doc/classes/ResourceLoader.xml index cf52f5017c1..398e8b61ee3 100644 --- a/doc/classes/ResourceLoader.xml +++ b/doc/classes/ResourceLoader.xml @@ -35,6 +35,12 @@ Returns the dependencies for the resource at the given [param path]. + [b]Note:[/b] The dependencies are returned with slices separated by [code]::[/code]. You can use [method String.get_slice] to get their components. + [codeblock] + for dep in ResourceLoader.get_dependencies(path): + print(dep.get_slice("::", 0)) # Prints UID. + print(dep.get_slice("::", 2)) # Prints path. + [/codeblock]