Module tier stat display (#7054)

This commit is contained in:
MEEPofFaith
2022-06-20 16:36:52 -07:00
committed by GitHub
parent 55e1a15eee
commit 59b7cddd7d
4 changed files with 18 additions and 1 deletions

View File

@@ -133,7 +133,9 @@ public class UnitAssembler extends PayloadBlock{
stats.add(Stat.output, table -> {
table.row();
int tier = 0;
for(var plan : plans){
int ttier = tier;
table.table(t -> {
t.setBackground(Tex.whiteui);
t.setColor(Pal.darkestGray);
@@ -146,9 +148,14 @@ public class UnitAssembler extends PayloadBlock{
if(plan.unit.unlockedNow()){
t.image(plan.unit.uiIcon).size(40).pad(10f).left();
t.table(info -> {
info.add(plan.unit.localizedName).left();
info.defaults().left();
info.add(plan.unit.localizedName);
info.row();
info.add(Strings.autoFixed(plan.time / 60f, 1) + " " + Core.bundle.get("unit.seconds")).color(Color.lightGray);
if(ttier > 0){
info.row();
info.add(Stat.moduleTier.localized() + ": " + ttier).color(Color.lightGray);
}
}).left();
t.table(req -> {
@@ -167,6 +174,7 @@ public class UnitAssembler extends PayloadBlock{
}
}).growX().pad(5);
table.row();
tier++;
}
});
}

View File

@@ -28,6 +28,13 @@ public class UnitAssemblerModule extends PayloadBlock{
acceptsPayload = true;
}
@Override
public void setStats(){
super.setStats();
stats.add(Stat.moduleTier, tier);
}
@Override
public void drawPlace(int x, int y, int rotation, boolean valid){
super.drawPlace(x, y, rotation, valid);

View File

@@ -89,6 +89,7 @@ public class Stat implements Comparable<Stat>{
ammoUse = new Stat("ammoUse", StatCat.function),
shieldHealth = new Stat("shieldHealth", StatCat.function),
cooldownTime = new Stat("cooldownTime", StatCat.function),
moduleTier = new Stat("moduletier", StatCat.function),
booster = new Stat("booster", StatCat.optional),
boostEffect = new Stat("boostEffect", StatCat.optional),