[editor only] Fix project conflicting atlas names during import

This commit is contained in:
fgnm
2023-02-05 11:56:41 +01:00
parent 76d9c73fcc
commit bd2e0710c3
@@ -50,10 +50,13 @@ public class AtlasAsset extends Asset {
projectManager.copyImageFilesForAllResolutionsIntoProject(images, true, progressHandler);
FileUtils.forceDelete(tmpDir.file());
TexturePackVO texturePackVO = projectManager.getCurrentProjectInfoVO().imagesPacks.get(fileHandle.nameWithoutExtension());
String name = fileHandle.nameWithoutExtension();
if (name.equals("pack")) name = name + "Import";
TexturePackVO texturePackVO = projectManager.getCurrentProjectInfoVO().imagesPacks.get(name);
if (texturePackVO == null) {
texturePackVO = new TexturePackVO();
texturePackVO.name = fileHandle.nameWithoutExtension();
texturePackVO.name = name;
projectManager.getCurrentProjectInfoVO().imagesPacks.put(texturePackVO.name, texturePackVO);
}