/// <summary>
        /// Updates the console HUD using data from all equipment modules across all upgrade consoles.
        /// </summary>
        /// <param name="hudManager">The console HUD manager.</param>
        internal void SlowUpdate(CyclopsUpgradeConsoleHUDManager hudManager)
        {
            if (!consoleIconsRemoved)
            {
                hudManager.ToggleAllIconsOff();
                consoleIconsRemoved = true;
            }

            if (upgradesText == null)
            {
                upgradesText = hudManager.subRoot.transform.Find("UpgradeConsoleHUD")?.Find("Canvas_Main")?.Find("Text")?.GetComponent <Text>();
            }

            if (upgradesText != null)
            {
                upgradesText.fontSize = 70;
                upgradesText.text     = hudManager.subRoot.GetSubName();
            }

            int   currentReservePower = this.ChargeManager.GetTotalReservePower();
            float currentBatteryPower = Cyclops.powerRelay.GetPower();

            int   TotalPowerUnits   = Mathf.CeilToInt(currentBatteryPower + currentReservePower);
            float normalMaxPower    = Cyclops.powerRelay.GetMaxPower();
            int   normalMaxPowerInt = Mathf.CeilToInt(normalMaxPower);

            hudManager.energyCur.color = NumberFormatter.GetNumberColor(currentBatteryPower, normalMaxPower, 0f);
            hudManager.energyCur.text  = NumberFormatter.FormatValue(TotalPowerUnits);

            if (hudManager.lastMaxSubPowerDisplayed != normalMaxPowerInt)
            {
                hudManager.energyMax.text           = "/" + NumberFormatter.FormatValue(normalMaxPowerInt);
                hudManager.lastMaxSubPowerDisplayed = normalMaxPowerInt;
            }

            settings.UpdateCyclopsMaxPower(normalMaxPower);

            if (totalPowerInfoIcons > 0)
            {
                powerIconTextVisibility =
                    Player.main.currentSub == Cyclops &&
                    holographicHUD != null &&
                    Mathf.Abs(Vector3.Distance(holographicHUD.transform.position, Player.main.transform.position)) <= 4f;

                if (lastKnownTextVisibility != powerIconTextVisibility)
                {
                    UpdatePowerIcons();
                    lastKnownTextVisibility = powerIconTextVisibility;
                }
            }
        }
        public Color GetIndicatorTextColor()
        {
            switch (ThermalState)
            {
            case ThermalState.HeatAvailable:
                return(NumberFormatter.GetNumberColor(temperature, MaxTemperature, MinUsableTemperature));

            case ThermalState.BatteryAvailable:
                return(NumberFormatter.GetNumberColor(this.ThermalChargerMk2.TotalBatteryCharge, this.ThermalChargerMk2.TotalBatteryCapacity, 0f));

            default:
                return(Color.white);
            }
        }
예제 #3
0
        public Color GetIndicatorTextColor()
        {
            switch (SolarState)
            {
            case SolarState.SunAvailable:
                return(NumberFormatter.GetNumberColor(solarPercentage, MaxSolarPercentage, 0f));

            case SolarState.BatteryAvailable:
                return(NumberFormatter.GetNumberColor(this.SolarChargerMk2.TotalBatteryCharge, this.SolarChargerMk2.TotalBatteryCapacity, 0f));

            default:
                return(Color.white);
            }
        }
        /// <summary>
        /// Updates the console HUD using data from all equipment modules across all upgrade consoles.
        /// </summary>
        /// <param name="hudManager">The console HUD manager.</param>
        internal void SlowUpdate(CyclopsUpgradeConsoleHUDManager hudManager)
        {
            if (!Cyclops.LOD.IsFull() || Player.main.currentSub != Cyclops || !Cyclops.live.IsAlive())
            {
                return; // Same early exit
            }

            hudManager.healthCur.text = IntStringCache.GetStringForInt(Mathf.FloorToInt(hudManager.liveMixin.health));
            int maxHealth = Mathf.CeilToInt(hudManager.liveMixin.health);

            if (hudManager.lastHealthMaxDisplayed != maxHealth)
            {
                hudManager.healthMax.text         = "/" + IntStringCache.GetStringForInt(maxHealth);
                hudManager.lastHealthMaxDisplayed = maxHealth;
            }

            int   currentReservePower = this.ChargeManager.GetTotalReservePower();
            float currentBatteryPower = Cyclops.powerRelay.GetPower();

            int   TotalPowerUnits   = Mathf.CeilToInt(currentBatteryPower + currentReservePower);
            float normalMaxPower    = Cyclops.powerRelay.GetMaxPower();
            int   normalMaxPowerInt = Mathf.CeilToInt(normalMaxPower);

            hudManager.energyCur.color = NumberFormatter.GetNumberColor(currentBatteryPower, normalMaxPower, 0f);
            hudManager.energyCur.text  = NumberFormatter.FormatValue(TotalPowerUnits);

            if (hudManager.lastMaxSubPowerDisplayed != normalMaxPowerInt)
            {
                hudManager.energyMax.text           = "/" + NumberFormatter.FormatValue(normalMaxPowerInt);
                hudManager.lastMaxSubPowerDisplayed = normalMaxPowerInt;
            }

            settings.UpdateCyclopsMaxPower(normalMaxPower);

            if (totalPowerInfoIcons > 0)
            {
                powerIconTextVisibility =
                    Player.main.currentSub == Cyclops &&
                    holographicHUD != null &&
                    Mathf.Abs(Vector3.Distance(holographicHUD.transform.position, Player.main.transform.position)) <= 4f;

                if (lastKnownTextVisibility != powerIconTextVisibility)
                {
                    UpdatePowerIcons();
                    lastKnownTextVisibility = powerIconTextVisibility;
                }
            }
        }
        public override void UpdateText()
        {
            float displayTemperature = Mathf.Max(chargeHandler.HeatLevel, 24f);

            if (chargeHandler.IsOverheated)
            {
                base.UpperText.TextString = CyclopsNuclearModule.OverheatMsg;
                base.UpperText.FontSize   = 14;
            }
            else
            {
                base.UpperText.TextString = NumberFormatter.FormatValue(displayTemperature) + "°C";
                base.UpperText.FontSize   = 20;
            }

            base.UpperText.TextColor = chargeHandler.StatusTextColor();

            if (battery != null)
            {
                base.LowerText.TextString = NumberFormatter.FormatValue(battery._charge);
                base.MiddleText.TextColor = NumberFormatter.GetNumberColor(battery._charge, CyclopsNuclearModule.NuclearEnergyPotential, 0f);
            }
        }
예제 #6
0
        public override void UpdateText()
        {
            int count = upgradeHandler.Count;

            UpperText.TextString = $"{(upgradeHandler.MaxLimitReached ? "Max" : count.ToString())} Charger{(count != 1 ? "s" : string.Empty)}";
            UpperText.FontSize   = 16;

            if (upgradeHandler.ChargeMultiplier > 1f)
            {
                base.MiddleText.TextString = $"{charger.EnergyStatusText()}\n+{Mathf.CeilToInt((upgradeHandler.ChargeMultiplier - 1f) * 100f)}%";
            }
            else
            {
                base.MiddleText.TextString = $"{charger.EnergyStatusText()}";
            }

            base.MiddleText.FontSize = 16;

            if (battery != null)
            {
                base.LowerText.TextString = NumberFormatter.FormatValue(battery._charge);
                base.LowerText.TextColor  = NumberFormatter.GetNumberColor(battery._charge, battery._capacity, 0f);
            }
        }
예제 #7
0
 public override Color StatusTextColor()
 {
     // Use color to inform heat levels
     return(NumberFormatter.GetNumberColor(MaxHeatLoad - this.HeatLevel, MaxHeatLoad, 0f));
 }
예제 #8
0
 public override Color StatusTextColor()
 {
     return(NumberFormatter.GetNumberColor(totalBioCharge, totalBioCapacity, 0f));
 }
예제 #9
0
 public override Color StatusTextColor()
 {
     return(ambientEnergyAvailable
         ? NumberFormatter.GetNumberColor(energyStatus, this.MaximumEnergyStatus, this.MinimumEnergyStatus)
         : NumberFormatter.GetNumberColor(this.AmbientEnergyUpgrade.TotalBatteryCharge, this.AmbientEnergyUpgrade.TotalBatteryCapacity, 0f));
 }
 public Color GetIndicatorTextColor()
 {
     return(NumberFormatter.GetNumberColor(this.NuclearCharger.TotalBatteryCharge, this.NuclearCharger.TotalBatteryCapacity, 0f));
 }
 public override Color StatusTextColor()
 {
     return(this.SolarEnergyAvailable ? NumberFormatter.GetNumberColor(energyStatus, 90f, 5f) : Color.white);
 }
예제 #12
0
 public override Color StatusTextColor()
 {
     return(this.ThermalEnergyAvailable ? NumberFormatter.GetNumberColor(this.Temperature, MaxTemperatureForColor, MinTemperatureForCharge) : Color.white);
 }
 public Color GetIndicatorTextColor()
 {
     return(NumberFormatter.GetNumberColor(totalBioCharge, totalBioCapacity, 0f));
 }