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;