Cleanup
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package mindustry.tools;
|
||||
|
||||
import arc.*;
|
||||
import arc.files.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
@@ -134,7 +135,9 @@ public class Generators{
|
||||
}
|
||||
}
|
||||
|
||||
image.save("block-" + block.name + "-full");
|
||||
if(!(regions.length == 1 && regions[0] == Core.atlas.find(block.name))){
|
||||
image.save("block-" + block.name + "-full");
|
||||
}
|
||||
|
||||
image.save("../editor/" + block.name + "-icon-editor");
|
||||
|
||||
@@ -211,7 +214,7 @@ public class Generators{
|
||||
});
|
||||
|
||||
ImagePacker.generate("unit-icons", () -> {
|
||||
content.units().each(type -> !type.flying, type -> {
|
||||
content.units().each(type -> {
|
||||
type.load();
|
||||
|
||||
Image image = ImagePacker.get(type.region);
|
||||
@@ -223,6 +226,12 @@ public class Generators{
|
||||
}
|
||||
image.draw(type.region);
|
||||
|
||||
Image baseCell = ImagePacker.get(type.cellRegion);
|
||||
Image cell = new Image(type.cellRegion.getWidth(), type.cellRegion.getHeight());
|
||||
cell.each((x, y) -> cell.draw(x, y, baseCell.getColor(x, y).mul(Color.gray)));
|
||||
|
||||
image.draw(cell, image.width/2 - cell.width/2, image.height/2 - cell.height/2);
|
||||
|
||||
for(Weapon weapon : type.weapons){
|
||||
weapon.load();
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mindustry.tools;
|
||||
|
||||
import arc.func.*;
|
||||
import arc.graphics.Color;
|
||||
import arc.graphics.g2d.TextureRegion;
|
||||
import arc.util.Structs;
|
||||
@@ -54,6 +55,14 @@ class Image{
|
||||
return color;
|
||||
}
|
||||
|
||||
void each(Intc2 cons){
|
||||
for(int x = 0; x < width; x++){
|
||||
for(int y = 0; y < height; y++){
|
||||
cons.get(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void draw(int x, int y, Color color){
|
||||
graphics.setColor(new java.awt.Color(color.r, color.g, color.b, color.a));
|
||||
graphics.fillRect(x, y, 1, 1);
|
||||
|
||||
Reference in New Issue
Block a user