WIP team icons

This commit is contained in:
Anuken
2021-07-31 18:23:22 -04:00
parent 78c35221be
commit 79bf77f4be
10 changed files with 32 additions and 3 deletions

View File

@@ -390,6 +390,19 @@ public class Generators{
}
});
generate("team-icons", () -> {
for(Team team : Team.all){
if(has("team-" + team.name)){
int rgba = team == Team.derelict ? Color.valueOf("b7b8c9").rgba() : team.color.rgba();
Pixmap base = get("team-" + team.name);
base.each((x, y) -> base.setRaw(x, y, Color.muli(base.getRaw(x, y), rgba)));
delete("team-" + team.name);
save(base.outline(Pal.gray, 3), "../ui/team-" + team.name);
}
}
});
generate("unit-icons", () -> content.units().each(type -> {
if(type.isHidden()) return; //hidden units don't generate

View File

@@ -236,6 +236,10 @@ public class ImagePacker{
base.draw(image, 0, 0, image.width, image.height, base.width/2 - wx/2, base.height/2 - wy/2, wx, wy, true, true);
}
static void delete(String name){
((GenRegion)Core.atlas.find(name)).path.delete();
}
static void replace(String name, Pixmap image){
Fi.get(name + ".png").writePng(image);
((GenRegion)Core.atlas.find(name)).path.delete();