mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-09 19:49:27 +02:00
better progress bar
This commit is contained in:
@@ -21,6 +21,7 @@ public class BlockDraw extends OverDraw {
|
||||
BlockDraw(String name, TextureRegionDrawable icon) {
|
||||
super(name, icon);
|
||||
registerOption("blockBar");
|
||||
registerOption("blockstatus");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,17 +50,17 @@ public class BlockDraw extends OverDraw {
|
||||
Building b = tile.build;
|
||||
|
||||
if(settings.getBool("blockBar")) {
|
||||
drawBar(b, 0, -(b.block.size * 4 + 2), b.healthf(), Pal.health);
|
||||
drawBar(b, 0, -(b.block.size * 4 - 2), b.healthf(), Pal.health);
|
||||
|
||||
if(b instanceof Turret.TurretBuild turretBuild)
|
||||
drawBar(b, 0, b.block.size * 4 + 2, turretBuild.reloadCounter / ((Turret) b.block).reload, Pal.ammo);
|
||||
drawBar(b, 0, b.block.size * 4 - 2, turretBuild.reloadCounter / ((Turret) b.block).reload, Pal.ammo);
|
||||
|
||||
if(b instanceof ConstructBlock.ConstructBuild constructBuild)
|
||||
drawBar(b, 0, b.block.size * 4 + 2, constructBuild.progress(), b.team.color);
|
||||
drawBar(b, 0, b.block.size * 4 - 2, constructBuild.progress(), b.team.color);
|
||||
if(b instanceof Reconstructor.ReconstructorBuild reconstructorBuild)
|
||||
drawBar(b, 0, b.block.size * 4 + 2, reconstructorBuild.fraction(), b.team.color);
|
||||
drawBar(b, 0, b.block.size * 4 - 2, reconstructorBuild.fraction(), b.team.color);
|
||||
if(b instanceof UnitFactory.UnitFactoryBuild factoryBuild)
|
||||
drawBar(b, 0, b.block.size * 4 + 2, factoryBuild.fraction(), b.team.color);
|
||||
drawBar(b, 0, b.block.size * 4 - 2, factoryBuild.fraction(), b.team.color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,10 @@ public class OverDraw {
|
||||
parent.left();
|
||||
options.each(name-> parent
|
||||
.check(bundle.get("setting."+name+".name"), settings.getBool(name), b->settings.put(name, b))
|
||||
.tooltip(t->t.background(Styles.black8).add(bundle.get("setting."+name+".description")))
|
||||
.tooltip(t-> {
|
||||
if(bundle.has("setting."+name+".description"))
|
||||
t.background(Styles.black8).add(bundle.get("setting."+name+".description"));
|
||||
})
|
||||
.disabled(!enabled)
|
||||
.left().row());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user