Scrapped reaper segments

This commit is contained in:
Anuken
2020-06-12 13:32:00 -04:00
parent ce9f515543
commit a76cb3cb1a
35 changed files with 5157 additions and 4487 deletions

View File

@@ -244,45 +244,55 @@ public class Generators{
}
});
ImagePacker.generate("unit-icons", () -> {
content.units().each(type -> {
type.load();
try{
ImagePacker.generate("unit-icons", () -> content.units().each(type -> {
if(type.isHidden()) return; //hidden units don't generate
Image image = ImagePacker.get(type.region);
type.load();
if(type.constructor.get() instanceof Mechc){
image.drawCenter(type.baseRegion);
image.drawCenter(type.legRegion);
image.drawCenter(type.legRegion, true, false);
}
image.draw(type.region);
Image image = ImagePacker.get(type.parts > 0 ? type.partRegions[0] : type.region);
for(int i = 1; i < type.parts; i++){
image.draw(ImagePacker.get(type.partRegions[i]));
}
if(type.parts > 0){
image.save(type.name);
}
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.valueOf("ffa665"))));
if(type.constructor.get() instanceof Mechc){
image.drawCenter(type.baseRegion);
image.drawCenter(type.legRegion);
image.drawCenter(type.legRegion, true, false);
image.draw(type.region);
}
image.draw(cell, image.width / 2 - cell.width / 2, image.height / 2 - cell.height / 2);
Image baseCell = ImagePacker.get(type.parts > 0 ? type.partCellRegions[0] : type.cellRegion);
for(int i = 1; i < type.parts; i++){
baseCell.draw(ImagePacker.get(type.partCellRegions[i]));
}
for(Weapon weapon : type.weapons){
weapon.load();
if(type.parts > 0){
image.save(type.name + "-cell");
}
for(int i : (weapon.mirror ? Mathf.signs : Mathf.one)){
i *= Mathf.sign(weapon.flipped);
Image cell = new Image(type.cellRegion.getWidth(), type.cellRegion.getHeight());
cell.each((x, y) -> cell.draw(x, y, baseCell.getColor(x, y).mul(Color.valueOf("ffa665"))));
image.draw(weapon.region,
(int)(i * weapon.x / Draw.scl + image.width / 2 - weapon.region.getWidth() / 2),
(int)(-weapon.y / Draw.scl + image.height / 2f - weapon.region.getHeight() / 2f),
i > 0, false);
}
}
image.draw(cell, image.width / 2 - cell.width / 2, image.height / 2 - cell.height / 2);
image.save("unit-" + type.name + "-full");
}catch(IllegalArgumentException ignored){
//skip
for(Weapon weapon : type.weapons){
weapon.load();
for(int i : (weapon.mirror ? Mathf.signs : Mathf.one)){
i *= Mathf.sign(weapon.flipped);
image.draw(weapon.region,
(int)(i * weapon.x / Draw.scl + image.width / 2 - weapon.region.getWidth() / 2),
(int)(-weapon.y / Draw.scl + image.height / 2f - weapon.region.getHeight() / 2f),
i > 0, false);
}
});
});
}
image.save("unit-" + type.name + "-full");
}));
ImagePacker.generate("ore-icons", () -> {
content.blocks().<OreBlock>each(b -> b instanceof OreBlock, ore -> {