mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Add has_extension() method to String
This commit is contained in:
@@ -1466,7 +1466,7 @@ void ResourceFormatLoaderText::get_classes_used(const String &p_path, HashSet<St
|
||||
}
|
||||
|
||||
String ResourceFormatLoaderText::get_resource_type(const String &p_path) const {
|
||||
String ext = p_path.get_extension().to_lower();
|
||||
const String ext = p_path.get_extension().to_lower();
|
||||
if (ext == "tscn") {
|
||||
return "PackedScene";
|
||||
} else if (ext != "tres") {
|
||||
@@ -1488,8 +1488,7 @@ String ResourceFormatLoaderText::get_resource_type(const String &p_path) const {
|
||||
}
|
||||
|
||||
String ResourceFormatLoaderText::get_resource_script_class(const String &p_path) const {
|
||||
String ext = p_path.get_extension().to_lower();
|
||||
if (ext != "tres") {
|
||||
if (!p_path.has_extension("tres")) {
|
||||
return String();
|
||||
}
|
||||
|
||||
@@ -1507,8 +1506,7 @@ String ResourceFormatLoaderText::get_resource_script_class(const String &p_path)
|
||||
}
|
||||
|
||||
ResourceUID::ID ResourceFormatLoaderText::get_resource_uid(const String &p_path) const {
|
||||
String ext = p_path.get_extension().to_lower();
|
||||
|
||||
const String ext = p_path.get_extension().to_lower();
|
||||
if (ext != "tscn" && ext != "tres") {
|
||||
return ResourceUID::INVALID_ID;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user