mirror of https://github.com/godotengine/godot
Expose ResourceLoader::get_resource_type and ResourceLoader::get_resource_script_class
Co-Authored-By: Pedro J. Estébanez <RandomShaper@users.noreply.github.com>
This commit is contained in:
parent
47bc374edf
commit
14fb9358fc
|
|
@ -132,6 +132,14 @@ ResourceUID::ID ResourceLoader::get_resource_uid(const String &p_path) {
|
|||
return ::ResourceLoader::get_resource_uid(p_path);
|
||||
}
|
||||
|
||||
String ResourceLoader::get_resource_type(const String &p_path) {
|
||||
return ::ResourceLoader::get_resource_type(p_path);
|
||||
}
|
||||
|
||||
String ResourceLoader::get_resource_script_class(const String &p_path) {
|
||||
return ::ResourceLoader::get_resource_script_class(p_path);
|
||||
}
|
||||
|
||||
Vector<String> ResourceLoader::list_directory(const String &p_directory) {
|
||||
return ::ResourceLoader::list_directory(p_directory);
|
||||
}
|
||||
|
|
@ -151,6 +159,8 @@ void ResourceLoader::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("get_cached_ref", "path"), &ResourceLoader::get_cached_ref);
|
||||
ClassDB::bind_method(D_METHOD("exists", "path", "type_hint"), &ResourceLoader::exists, DEFVAL(""));
|
||||
ClassDB::bind_method(D_METHOD("get_resource_uid", "path"), &ResourceLoader::get_resource_uid);
|
||||
ClassDB::bind_method(D_METHOD("get_resource_type", "path"), &ResourceLoader::get_resource_type);
|
||||
ClassDB::bind_method(D_METHOD("get_resource_script_class", "path"), &ResourceLoader::get_resource_script_class);
|
||||
ClassDB::bind_method(D_METHOD("list_directory", "directory_path"), &ResourceLoader::list_directory);
|
||||
|
||||
BIND_ENUM_CONSTANT(THREAD_LOAD_INVALID_RESOURCE);
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ public:
|
|||
Ref<Resource> get_cached_ref(const String &p_path);
|
||||
bool exists(const String &p_path, const String &p_type_hint = "");
|
||||
ResourceUID::ID get_resource_uid(const String &p_path);
|
||||
String get_resource_type(const String &p_path);
|
||||
String get_resource_script_class(const String &p_path);
|
||||
|
||||
Vector<String> list_directory(const String &p_directory);
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,21 @@
|
|||
Returns the list of recognized extensions for a resource type.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_resource_script_class">
|
||||
<return type="String" />
|
||||
<param index="0" name="path" type="String" />
|
||||
<description>
|
||||
Returns the global script class name a given [param path], as set by the [code]class_name[/code] keyword in GDScript or the [code][GlobalClass][/code] attribute in C#.
|
||||
If there is none, it returns an empty string.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_resource_type">
|
||||
<return type="String" />
|
||||
<param index="0" name="path" type="String" />
|
||||
<description>
|
||||
Returns the type of the resource at the given [param path].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_resource_uid">
|
||||
<return type="int" />
|
||||
<param index="0" name="path" type="String" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue