Variant fixes

This commit is contained in:
Anuken
2019-10-10 09:13:12 -04:00
parent 720f7c0b0f
commit 36a21e2443
4 changed files with 15 additions and 3 deletions

View File

@@ -31,7 +31,11 @@ public abstract class UnlockableContent extends MappableContent{
/** Returns a specific content icon, or the region {contentType}-{name} if not found.*/
public TextureRegion icon(Cicon icon){
if(cicons[icon.ordinal()] == null){
cicons[icon.ordinal()] = Core.atlas.find(getContentType().name() + "-" + name + "-" + icon.name(), Core.atlas.find(getContentType().name() + "-" + name + "-full", Core.atlas.find(getContentType().name() + "-" + name, Core.atlas.find(name))));
cicons[icon.ordinal()] = Core.atlas.find(getContentType().name() + "-" + name + "-" + icon.name(),
Core.atlas.find(getContentType().name() + "-" + name + "-full",
Core.atlas.find(getContentType().name() + "-" + name,
Core.atlas.find(name,
Core.atlas.find(name + "1")))));
}
return cicons[icon.ordinal()];
}

View File

@@ -113,7 +113,7 @@ public class ContentParser{
block = Vars.content.getByName(ContentType.block, name);
if(value.has("type")){
throw new IllegalArgumentException("When overwriting an existing block, you may not declared its type. The original type will be used. Block: " + name);
throw new IllegalArgumentException("When overwriting an existing block, you must not re-declared its type. The original type will be used. Block: " + name);
}
}else{
//TODO generate dynamically instead of doing.. this

View File

@@ -94,6 +94,14 @@ public class Floor extends Block{
return;
}
if(variants > 0){
variantRegions();
for(int i = 0; i < variantRegions.length; i++){
editor.pack("editor-" + ((AtlasRegion)variantRegions[i]).name, Core.atlas.getPixmap((AtlasRegion)variantRegions[i]).crop());
}
}
Color color = new Color();
Color color2 = new Color();
PixmapRegion image = Core.atlas.getPixmap((AtlasRegion)generateIcons()[0]);

View File

@@ -35,7 +35,7 @@ public class OreBlock extends OverlayFloor{
@Override
@OverrideCallSuper
public void createIcons(PixmapPacker out, PixmapPacker editor){
for(int i = 0; i < 3; i++){
for(int i = 0; i < variants; i++){
Pixmap image = new Pixmap(32, 32);
PixmapRegion shadow = Core.atlas.getPixmap(itemDrop.name + (i + 1));