Removing Nulls.unit

This commit is contained in:
Anuken
2024-07-10 15:54:46 -04:00
parent e3ba8b714b
commit 295573142f
12 changed files with 106 additions and 188 deletions

View File

@@ -767,7 +767,7 @@ public class HudFragment{
}
});
t.add(new SideBar(() -> player.unit().healthf(), () -> true, true)).width(bw).growY().padRight(pad);
t.add(new SideBar(() -> player.dead() ? 0f : player.unit().healthf(), () -> true, true)).width(bw).growY().padRight(pad);
t.image(() -> player.icon()).scaling(Scaling.bounded).grow().maxWidth(54f);
t.add(new SideBar(() -> player.dead() ? 0f : player.displayAmmo() ? player.unit().ammof() : player.unit().healthf(), () -> !player.displayAmmo(), false)).width(bw).growY().padLeft(pad).update(b -> {
b.color.set(player.displayAmmo() ? player.dead() || player.unit() instanceof BlockUnitc ? Pal.ammo : player.unit().type.ammoType.color() : Pal.health);
@@ -913,7 +913,7 @@ public class HudFragment{
table.table().update(t -> {
t.left();
Bits applied = player.unit().statusBits();
Bits applied = player.unit() == null ? null : player.unit().statusBits();
if(!statuses.equals(applied)){
t.clear();