Skip to content

Commit

Permalink
[editor only] Fix Spine resource import
Browse files Browse the repository at this point in the history
  • Loading branch information
fgnm committed Jul 5, 2024
1 parent 0b00d6f commit 902663d
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,18 @@ private File importExternalAnimationIntoProject(FileHandle animationFileSource,
FileUtils.forceDelete(tmpDir.file());

for (TextureAtlas.TextureAtlasData.Region region : new Array.ArrayIterator<>(atlas.getRegions())) {
projectManager.getCurrentProjectInfoVO().animationsPacks.get("main").regions.add(fileNameWithOutExt+region.name);
String name = fileNameWithOutExt+region.name;
name = name.replaceAll("/", Matcher.quoteReplacement("$"));
boolean resDuplicated = false;
for (TexturePackVO texturePackVO : projectManager.getCurrentProjectInfoVO().animationsPacks.values()) {
if (texturePackVO.regions.contains(name)) {
resDuplicated = true;
break;
}
}
if (!resDuplicated) {
projectManager.getCurrentProjectInfoVO().animationsPacks.get("main").regions.add(name);
}
}

return jsonFileTarget;
Expand Down

0 comments on commit 902663d

Please sign in to comment.