From f3aec94c4860da0c069c13c5678f9be3d780ac85 Mon Sep 17 00:00:00 2001 From: Luis Gonzalez Date: Wed, 22 Jul 2026 18:26:24 -0700 Subject: [PATCH] HUD: ability bar defaults hidden until a local player exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the empty-bar leak into ArtStaging / menu / pre-connect: AbilityBarSystem.OnUpdate early-returns when there is no valid NetworkTime, so the 'hide when no local player' line never ran. Root now DisplayStyle.None at build, flips to Flex only when the local player is found — also kills any pre-connect flash in gameplay. --- .../_Project/Scripts/Client/Presentation/AbilityBarSystem.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/_Project/Scripts/Client/Presentation/AbilityBarSystem.cs b/Assets/_Project/Scripts/Client/Presentation/AbilityBarSystem.cs index 0302f8541..e5626644f 100644 --- a/Assets/_Project/Scripts/Client/Presentation/AbilityBarSystem.cs +++ b/Assets/_Project/Scripts/Client/Presentation/AbilityBarSystem.cs @@ -81,12 +81,14 @@ namespace ProjectM.Client bool haveDb = SystemAPI.TryGetSingleton(out var db) && db.Value.IsCreated; + bool foundLocal = false; // no local player (menu / ArtStaging / pre-spawn) -> hide the bar entirely foreach (var (cd, dashCd, entity) in SystemAPI.Query, RefRO>() .WithAll().WithEntityAccess()) { if (!EntityManager.HasBuffer(entity) || !EntityManager.HasBuffer(entity)) continue; + foundLocal = true; var sockets = EntityManager.GetBuffer(entity, true); var effs = EntityManager.GetBuffer(entity, true); @@ -108,6 +110,7 @@ namespace ProjectM.Client UpdateSlotCooldown(DashSlot, RemainingTicks(dashCd.ValueRO.NextTick, now), dashTotal); break; // one local player } + _doc.rootVisualElement.style.display = foundLocal ? DisplayStyle.Flex : DisplayStyle.None; } static int RemainingTicks(uint nextFireRaw, NetworkTick now) @@ -185,6 +188,7 @@ namespace ProjectM.Client root.style.position = Position.Absolute; root.style.left = 0; root.style.right = 0; root.style.top = 0; root.style.bottom = 0; root.pickingMode = PickingMode.Ignore; + root.style.display = DisplayStyle.None; // hidden until a local player is found (no flash in menu/ArtStaging/pre-connect) var bar = HudUi.Group(Align.Center); bar.style.position = Position.Absolute;