This commit is contained in:
Anuken
2023-06-03 11:47:19 -04:00
parent 37daf0a871
commit 038994a95f
5 changed files with 17 additions and 6 deletions

View File

@@ -195,10 +195,12 @@ public class Mods implements Loadable{
float textureScale = mod.meta.texturescale;
for(Fi file : sprites){
String name = file.nameWithoutExtension();
String
baseName = file.nameWithoutExtension(),
regionName = baseName.contains(".") ? baseName.substring(0, baseName.indexOf(".")) : baseName;
if(!prefix && !Core.atlas.has(name)){
Log.warn("Sprite '@' in mod '@' attempts to override a non-existent sprite. Ignoring.", name, mod.name);
if(!prefix && !Core.atlas.has(regionName)){
Log.warn("Sprite '@' in mod '@' attempts to override a non-existent sprite. Ignoring.", regionName, mod.name);
continue;
//(horrible code below)
@@ -215,7 +217,7 @@ public class Mods implements Loadable{
}
//this returns a *runnable* which actually packs the resulting pixmap; this has to be done synchronously outside the method
return () -> {
String fullName = (prefix ? mod.name + "-" : "") + name;
String fullName = (prefix ? mod.name + "-" : "") + baseName;
packer.add(getPage(file), fullName, new PixmapRegion(pix));
if(textureScale != 1.0f){
textureResize.put(fullName, textureScale);