Variant fixes
This commit is contained in:
@@ -31,7 +31,11 @@ public abstract class UnlockableContent extends MappableContent{
|
|||||||
/** Returns a specific content icon, or the region {contentType}-{name} if not found.*/
|
/** Returns a specific content icon, or the region {contentType}-{name} if not found.*/
|
||||||
public TextureRegion icon(Cicon icon){
|
public TextureRegion icon(Cicon icon){
|
||||||
if(cicons[icon.ordinal()] == null){
|
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()];
|
return cicons[icon.ordinal()];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ public class ContentParser{
|
|||||||
block = Vars.content.getByName(ContentType.block, name);
|
block = Vars.content.getByName(ContentType.block, name);
|
||||||
|
|
||||||
if(value.has("type")){
|
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{
|
}else{
|
||||||
//TODO generate dynamically instead of doing.. this
|
//TODO generate dynamically instead of doing.. this
|
||||||
|
|||||||
@@ -94,6 +94,14 @@ public class Floor extends Block{
|
|||||||
return;
|
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 color = new Color();
|
||||||
Color color2 = new Color();
|
Color color2 = new Color();
|
||||||
PixmapRegion image = Core.atlas.getPixmap((AtlasRegion)generateIcons()[0]);
|
PixmapRegion image = Core.atlas.getPixmap((AtlasRegion)generateIcons()[0]);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class OreBlock extends OverlayFloor{
|
|||||||
@Override
|
@Override
|
||||||
@OverrideCallSuper
|
@OverrideCallSuper
|
||||||
public void createIcons(PixmapPacker out, PixmapPacker editor){
|
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);
|
Pixmap image = new Pixmap(32, 32);
|
||||||
PixmapRegion shadow = Core.atlas.getPixmap(itemDrop.name + (i + 1));
|
PixmapRegion shadow = Core.atlas.getPixmap(itemDrop.name + (i + 1));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user