mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 12:09: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) {
|
BlockDraw(String name, TextureRegionDrawable icon) {
|
||||||
super(name, icon);
|
super(name, icon);
|
||||||
registerOption("blockBar");
|
registerOption("blockBar");
|
||||||
|
registerOption("blockstatus");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -49,17 +50,17 @@ public class BlockDraw extends OverDraw {
|
|||||||
Building b = tile.build;
|
Building b = tile.build;
|
||||||
|
|
||||||
if(settings.getBool("blockBar")) {
|
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)
|
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)
|
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)
|
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)
|
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();
|
parent.left();
|
||||||
options.each(name-> parent
|
options.each(name-> parent
|
||||||
.check(bundle.get("setting."+name+".name"), settings.getBool(name), b->settings.put(name, b))
|
.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)
|
.disabled(!enabled)
|
||||||
.left().row());
|
.left().row());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user