Skip to content

Commit 29a6e53

Browse files
committed
Expose ResourceLoader::get_resource_type and ResourceLoader::get_resource_script_class
1 parent 79a2335 commit 29a6e53

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

core/core_bind.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ ResourceUID::ID ResourceLoader::get_resource_uid(const String &p_path) {
123123
return ::ResourceLoader::get_resource_uid(p_path);
124124
}
125125

126+
String ResourceLoader::get_resource_type(const String &p_path) {
127+
return ::ResourceLoader::get_resource_type(p_path);
128+
}
129+
130+
String ResourceLoader::get_resource_script_class(const String &p_path) {
131+
return ::ResourceLoader::get_resource_script_class(p_path);
132+
}
133+
126134
void ResourceLoader::_bind_methods() {
127135
ClassDB::bind_method(D_METHOD("load_threaded_request", "path", "type_hint", "use_sub_threads", "cache_mode"), &ResourceLoader::load_threaded_request, DEFVAL(""), DEFVAL(false), DEFVAL(CACHE_MODE_REUSE));
128136
ClassDB::bind_method(D_METHOD("load_threaded_get_status", "path", "progress"), &ResourceLoader::load_threaded_get_status, DEFVAL(Array()));
@@ -137,6 +145,8 @@ void ResourceLoader::_bind_methods() {
137145
ClassDB::bind_method(D_METHOD("has_cached", "path"), &ResourceLoader::has_cached);
138146
ClassDB::bind_method(D_METHOD("exists", "path", "type_hint"), &ResourceLoader::exists, DEFVAL(""));
139147
ClassDB::bind_method(D_METHOD("get_resource_uid", "path"), &ResourceLoader::get_resource_uid);
148+
ClassDB::bind_method(D_METHOD("get_resource_type", "path"), &ResourceLoader::get_resource_type);
149+
ClassDB::bind_method(D_METHOD("get_resource_script_class", "path"), &ResourceLoader::get_resource_script_class);
140150

141151
BIND_ENUM_CONSTANT(THREAD_LOAD_INVALID_RESOURCE);
142152
BIND_ENUM_CONSTANT(THREAD_LOAD_IN_PROGRESS);

core/core_bind.h

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ class ResourceLoader : public Object {
8585
bool has_cached(const String &p_path);
8686
bool exists(const String &p_path, const String &p_type_hint = "");
8787
ResourceUID::ID get_resource_uid(const String &p_path);
88+
String get_resource_type(const String &p_path);
89+
String get_resource_script_class(const String &p_path);
8890

8991
ResourceLoader() { singleton = this; }
9092
};

0 commit comments

Comments
 (0)