Moved block icons to UI atlas
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 676 KiB |
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 276 KiB |
|
Before Width: | Height: | Size: 276 KiB After Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 459 KiB |
@@ -82,6 +82,7 @@ public class MinerDrone extends BaseDrone implements MinerTrait{
|
|||||||
|
|
||||||
public void update(){
|
public void update(){
|
||||||
if(item.amount == 0 || item.item.type != ItemType.material){
|
if(item.amount == 0 || item.item.type != ItemType.material){
|
||||||
|
clearItem();
|
||||||
setState(mine);
|
setState(mine);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -93,11 +94,11 @@ public class MinerDrone extends BaseDrone implements MinerTrait{
|
|||||||
TileEntity tile = (TileEntity)target;
|
TileEntity tile = (TileEntity)target;
|
||||||
|
|
||||||
if(dst(target) < type.range){
|
if(dst(target) < type.range){
|
||||||
if(tile.tile.block().acceptStack(item.item, item.amount, tile.tile, MinerDrone.this) == item.amount){
|
if(tile.tile.block().acceptStack(item.item, item.amount, tile.tile, MinerDrone.this) > 0){
|
||||||
Call.transferItemTo(item.item, item.amount, x, y, tile.tile);
|
Call.transferItemTo(item.item, item.amount, x, y, tile.tile);
|
||||||
item.amount = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearItem();
|
||||||
setState(mine);
|
setState(mine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -591,7 +591,8 @@ public class Block extends BlockStorage{
|
|||||||
|
|
||||||
public TextureRegion icon(Icon icon){
|
public TextureRegion icon(Icon icon){
|
||||||
if(icons[icon.ordinal()] == null){
|
if(icons[icon.ordinal()] == null){
|
||||||
icons[icon.ordinal()] = Core.atlas.find(name + "-icon-" + icon.name(), icon == Icon.full ? getGeneratedIcons()[0] : Core.atlas.find(name + "-icon-full", getGeneratedIcons()[0]));
|
icons[icon.ordinal()] = Core.atlas.find(name + "-icon-" + icon.name(), icon == Icon.full ?
|
||||||
|
getGeneratedIcons()[0] : Core.atlas.find(name + "-icon-full", getGeneratedIcons()[0]));
|
||||||
}
|
}
|
||||||
return icons[icon.ordinal()];
|
return icons[icon.ordinal()];
|
||||||
}
|
}
|
||||||
@@ -701,10 +702,11 @@ public class Block extends BlockStorage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum Icon{
|
public enum Icon{
|
||||||
|
//these are stored in the UI atlases
|
||||||
small(8 * 3),
|
small(8 * 3),
|
||||||
medium(8 * 4),
|
medium(8 * 4),
|
||||||
large(8 * 6),
|
large(8 * 6),
|
||||||
/** uses whatever the size of the block is */
|
/** uses whatever the size of the block is. this is always stored in the main game atlas! */
|
||||||
full(0);
|
full(0);
|
||||||
|
|
||||||
public final int size;
|
public final int size;
|
||||||
|
|||||||
@@ -143,17 +143,15 @@ public class Generators{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(regions.length > 1){
|
image.save(block.name + "-icon-full");
|
||||||
image.save(block.name + "-icon-full");
|
|
||||||
}
|
|
||||||
|
|
||||||
image.save("../editor/" + block.name + "-icon-editor");
|
image.save("../editor/" + block.name + "-icon-editor");
|
||||||
|
|
||||||
for(Icon icon : Icon.values()){
|
for(Icon icon : Icon.values()){
|
||||||
if(icon.size == 0 || (icon.size == image.width && icon.size == image.height)) continue;
|
if(icon.size == 0) continue;
|
||||||
Image scaled = new Image(icon.size, icon.size);
|
Image scaled = new Image(icon.size, icon.size);
|
||||||
scaled.drawScaled(image);
|
scaled.drawScaled(image);
|
||||||
scaled.save(block.name + "-icon-" + icon.name());
|
scaled.save("../ui/" + block.name + "-icon-" + icon.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
Color average = new Color();
|
Color average = new Color();
|
||||||
|
|||||||