|
@@ -112,6 +112,13 @@ PoolStringArray _ResourceLoader::get_dependencies(const String &p_path) {
|
|
return ret;
|
|
return ret;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+#ifndef DISABLE_DEPRECATED
|
|
|
|
+bool _ResourceLoader::has(const String &p_path) {
|
|
|
|
+ WARN_PRINTS("ResourceLoader.has() is deprecated, please replace it with the equivalent has_cached() or the new exists().");
|
|
|
|
+ return has_cached(p_path);
|
|
|
|
+}
|
|
|
|
+#endif // DISABLE_DEPRECATED
|
|
|
|
+
|
|
bool _ResourceLoader::has_cached(const String &p_path) {
|
|
bool _ResourceLoader::has_cached(const String &p_path) {
|
|
|
|
|
|
String local_path = ProjectSettings::get_singleton()->localize_path(p_path);
|
|
String local_path = ProjectSettings::get_singleton()->localize_path(p_path);
|
|
@@ -131,6 +138,9 @@ void _ResourceLoader::_bind_methods() {
|
|
ClassDB::bind_method(D_METHOD("get_dependencies", "path"), &_ResourceLoader::get_dependencies);
|
|
ClassDB::bind_method(D_METHOD("get_dependencies", "path"), &_ResourceLoader::get_dependencies);
|
|
ClassDB::bind_method(D_METHOD("has_cached", "path"), &_ResourceLoader::has_cached);
|
|
ClassDB::bind_method(D_METHOD("has_cached", "path"), &_ResourceLoader::has_cached);
|
|
ClassDB::bind_method(D_METHOD("exists", "path", "type_hint"), &_ResourceLoader::exists, DEFVAL(""));
|
|
ClassDB::bind_method(D_METHOD("exists", "path", "type_hint"), &_ResourceLoader::exists, DEFVAL(""));
|
|
|
|
+#ifndef DISABLE_DEPRECATED
|
|
|
|
+ ClassDB::bind_method(D_METHOD("has", "path"), &_ResourceLoader::has);
|
|
|
|
+#endif // DISABLE_DEPRECATED
|
|
}
|
|
}
|
|
|
|
|
|
_ResourceLoader::_ResourceLoader() {
|
|
_ResourceLoader::_ResourceLoader() {
|