Exemple #1
0
        public Hud()
        {
            if (Host.IsServer)
            {
                return;
            }

            RootPanel.StyleSheet.Load("/ui/Hud.scss");
            RootPanel.AddClass("panel");

            GeneralHudPanel  = RootPanel.AddChild <GeneralHud>();
            AliveHudInstance = new(RootPanel);
            Current          = this;
        }
Exemple #2
0
        public static void OnHotReloaded()
        {
            if (Host.IsServer)
            {
                return;
            }

            Current?.Delete();

            _ = new Hud();

            if (Local.Client.Pawn is Player player)
            {
                Current.AliveHudInstance.Enabled = player.LifeState == LifeState.Alive && !player.IsForcedSpectator;
            }

            GameEvent.Register(new Events.UI.ReloadedEvent());
        }