update sprites
This commit is contained in:
@@ -30,15 +30,17 @@ public class WeaponListValue implements StatValue{
|
||||
@Override
|
||||
public void display(Table table){
|
||||
table.row();
|
||||
for(Weapon weapon : weapons){
|
||||
for(int i = 0;i < weapons.size;i ++){
|
||||
Weapon weapon = weapons.get(i);
|
||||
|
||||
if(weapon.flipSprite){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(weapon.outlineRegion.found()){
|
||||
table.image(weapon.outlineRegion).size(10 * 8).right().top();
|
||||
table.image(Core.atlas.find(unit.name + "-weapon" + i)).size(15 * 8).right().top();
|
||||
}else{
|
||||
table.image(unit.icon(Cicon.full)).size(10 * 8).right().top();
|
||||
table.image(unit.icon(Cicon.full)).size(15 * 8).right().top();
|
||||
}
|
||||
|
||||
table.table(Tex.underline, w -> {
|
||||
|
||||
@@ -505,6 +505,32 @@ public class Generators{
|
||||
}
|
||||
}
|
||||
|
||||
//generate weapon stat UI
|
||||
//TODO: optimize
|
||||
Image base = new Image(image.width, image.height);
|
||||
|
||||
image.each((x, y) -> {
|
||||
Color c = image.getColor(x, y);
|
||||
base.draw(x, y, c.set(c.r, c.g, c.b, c.a * 0.2f));
|
||||
});
|
||||
|
||||
for(int i = 0;i < type.weapons.size;i ++){
|
||||
Weapon weapon = type.weapons.get(i);
|
||||
|
||||
if(weapon.flipSprite){
|
||||
continue;
|
||||
}
|
||||
|
||||
weapon.load();
|
||||
Image finalBase = base.copy();
|
||||
|
||||
finalBase.draw(outline.get(ImagePacker.get(weapon.region)),
|
||||
(int)(weapon.x / Draw.scl + base.width / 2f - weapon.region.width / 2f),
|
||||
(int)(-weapon.y / Draw.scl + base.height / 2f - weapon.region.height / 2f),
|
||||
weapon.flipSprite, false);
|
||||
|
||||
finalBase.save(type.name + "-weapon" + i);
|
||||
}
|
||||
}catch(IllegalArgumentException e){
|
||||
Log.err("WARNING: Skipping unit @: @", type.name, e.getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user