This commit is contained in:
Anuken
2020-04-25 23:14:12 -04:00
parent 08f8323465
commit fa62336096
7 changed files with 3331 additions and 3873 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 762 KiB

After

Width:  |  Height:  |  Size: 715 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 125 KiB

View File

@@ -1,5 +1,6 @@
package mindustry.tools; package mindustry.tools;
import arc.*;
import arc.files.*; import arc.files.*;
import arc.graphics.*; import arc.graphics.*;
import arc.graphics.g2d.*; 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"); image.save("../editor/" + block.name + "-icon-editor");
@@ -211,7 +214,7 @@ public class Generators{
}); });
ImagePacker.generate("unit-icons", () -> { ImagePacker.generate("unit-icons", () -> {
content.units().each(type -> !type.flying, type -> { content.units().each(type -> {
type.load(); type.load();
Image image = ImagePacker.get(type.region); Image image = ImagePacker.get(type.region);
@@ -223,6 +226,12 @@ public class Generators{
} }
image.draw(type.region); 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){ for(Weapon weapon : type.weapons){
weapon.load(); weapon.load();

View File

@@ -1,5 +1,6 @@
package mindustry.tools; package mindustry.tools;
import arc.func.*;
import arc.graphics.Color; import arc.graphics.Color;
import arc.graphics.g2d.TextureRegion; import arc.graphics.g2d.TextureRegion;
import arc.util.Structs; import arc.util.Structs;
@@ -54,6 +55,14 @@ class Image{
return color; 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){ void draw(int x, int y, Color color){
graphics.setColor(new java.awt.Color(color.r, color.g, color.b, color.a)); graphics.setColor(new java.awt.Color(color.r, color.g, color.b, color.a));
graphics.fillRect(x, y, 1, 1); graphics.fillRect(x, y, 1, 1);