Ejemplo n.º 1
0
        private CuiElementContainer CreateHealthIndicator(CS_Helicopter heli)
        {
            var panelName = $"csHeli_{heli.UIHealth}";
            var pos       = CalcHealthPos(heli.UIHealth);
            var element   = EventManager.UI.CreateElementContainer(panelName, "0.1 0.1 0.1 0.7", $"{pos[0]} {pos[1]}", $"{pos[2]} {pos[3]}", false);

            CreateHealthElement(ref element, panelName, "Body Health", heli.MaxBody, heli.BodyHealth, 0.75f);
            CreateHealthElement(ref element, panelName, "Main Rotor", heli.MaxMain, heli.MainHealth, 0.5f);
            CreateHealthElement(ref element, panelName, "Tail Rotor", heli.MaxTail, heli.TailHealth, 0.25f);
            CreateHealthElement(ref element, panelName, "Engine Health", heli.MaxEngine, heli.EngineHealth, 0f);

            return(element);
        }
Ejemplo n.º 2
0
 private void RefreshHealthUI(CS_Helicopter heli)
 {
     if (!heli)
     {
         return;
     }
     if (config.EventSettings.ShowHeliHealthUI)
     {
         foreach (var entry in CSPlayers)
         {
             CuiHelper.DestroyUi(entry.player, $"csHeli_{heli.UIHealth}");
             CuiHelper.AddUi(entry.player, CreateHealthIndicator(heli));
         }
     }
 }