You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-22 15:06:45 +00:00
Added ability for multiple images to be imported as an atlas
This adds support for groups in the import system, which point to a single file. Add property hint for saving files in file field
This commit is contained in:
@@ -608,6 +608,30 @@ int ResourceLoader::get_import_order(const String &p_path) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
String ResourceLoader::get_import_group_file(const String &p_path) {
|
||||
String path = _path_remap(p_path);
|
||||
|
||||
String local_path;
|
||||
if (path.is_rel_path())
|
||||
local_path = "res://" + path;
|
||||
else
|
||||
local_path = ProjectSettings::get_singleton()->localize_path(path);
|
||||
|
||||
for (int i = 0; i < loader_count; i++) {
|
||||
|
||||
if (!loader[i]->recognize_path(local_path))
|
||||
continue;
|
||||
/*
|
||||
if (p_type_hint!="" && !loader[i]->handles_type(p_type_hint))
|
||||
continue;
|
||||
*/
|
||||
|
||||
return loader[i]->get_import_group_file(p_path);
|
||||
}
|
||||
|
||||
return String(); //not found
|
||||
}
|
||||
|
||||
bool ResourceLoader::is_import_valid(const String &p_path) {
|
||||
|
||||
String path = _path_remap(p_path);
|
||||
|
||||
Reference in New Issue
Block a user