Beispiel #1
0
        // Manage Battery Icons
        internal static void BatteryShowIn()
        {
            if (ManageAllGUIElements.BatterySlotGrayUIGameObject != null)
            {
                ManageAllGUIElements.BatterySlotGrayUIGameObject.SetActive(false);
            }
            if (ManageAllGUIElements.BatteryOutUIGameObject != null)
            {
                ManageAllGUIElements.BatteryOutUIGameObject.SetActive(false);
            }
            if (ManageAllGUIElements.BatteryArrowsUIGameObject != null)
            {
                ManageAllGUIElements.BatteryArrowsUIGameObject.SetActive(false);
            }

            if (ManageAllGUIElements.BatteryInUIGameObject == null)
            {
                ManageAllGUIElements.BatteryInUIGameObject = PrepareGUIObjects.PrepareGUIObject("BatteryInUI", GearInfo.battery_Position);
            }
            if (ManageAllGUIElements.BatteryInUIGameObject != null)
            {
                ManageAllGUIElements.BatteryInUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.BatteryInUIGameObject, "battery_in_100x100", GearInfo.battery_Position, GearInfo.battery_Size);
            }

            if (ManageAllGUIElements.BatteryInUIGameObject != null)
            {
                ManageAllGUIElements.BatteryInUIGameObject.SetActive(true);
            }
        }
        // Manage add-on health text description
        internal static void ManageHealthText()
        {
            if (ManageAllGUIElements.HealthTextObject == null)
            {
                ManageAllGUIElements.HealthTextObject = PrepareGUIObjects.PrepareGUIObject("HealthTextUI", GearInfo.health_txt_Position);
            }

            // (Object, font size modifier, dual color / gray, is module in, what color if not gray, text type)
            if (ManageAllGUIElements.HealthTextObject != null)
            {
                ManageAllGUIElements.HealthTextObject = PrepareGUITxt.PrepareTxtElement(ManageAllGUIElements.HealthTextObject, 2f, false, SeamothInfo.electronicModuleIn, Color.white, GearInfo.health_txt_Position, GearInfo.health_txt_Size);
            }

            GearInfo.healthDisplayText = ManageAllGUIElements.HealthTextObject.GetComponent <Text>();

            if (SeamothInfo.electronicModuleIn)
            {
                string colorStartDesc;
                string colorWhite = "<color=white>";
                string colorGrey  = "<color=grey>";
                string colorEnd   = "</color>";

                if (SeamothInfo.seamothLinkModuleIn)
                {
                    colorStartDesc = colorWhite;
                }
                else
                {
                    colorStartDesc = colorGrey;
                }

                if (Config.MarchThroughHealthValue == 1f)
                {
                    GearInfo.healthDisplayText.text = (colorStartDesc + "Health max units" + colorEnd);
                }
                else if (Config.MarchThroughHealthValue == 2f)
                {
                    GearInfo.healthDisplayText.text = (colorStartDesc + "Health units" + colorEnd);
                }
                else
                {
                    GearInfo.healthDisplayText.text = (colorStartDesc + "Health %" + colorEnd);
                }

                if (ManageAllGUIElements.HealthTextObject != null)
                {
                    ManageAllGUIElements.HealthTextObject.SetActive(true);
                }
            }
            else
            {
                if (ManageAllGUIElements.HealthTextObject != null)
                {
                    ManageAllGUIElements.HealthTextObject.SetActive(false);
                }
            }
        }
        // Manage add-on temperature text description
        internal static void ManageTemperText()
        {
            if (ManageAllGUIElements.TemperTextObject == null)
            {
                ManageAllGUIElements.TemperTextObject = PrepareGUIObjects.PrepareGUIObject("TemperTextUI", GearInfo.temper_txt_Position);
            }

            if (ManageAllGUIElements.TemperTextObject != null)
            {
                ManageAllGUIElements.TemperTextObject = PrepareGUITxt.PrepareTxtElement(ManageAllGUIElements.TemperTextObject, 2f, false, SeamothInfo.electronicModuleIn, Color.white, GearInfo.temper_txt_Position, GearInfo.temper_txt_Size);
            }

            GearInfo.temperDisplayText = ManageAllGUIElements.TemperTextObject.GetComponent <Text>();

            if (SeamothInfo.electronicModuleIn)
            {
                string colorStartDesc;
                string colorWhite = "<color=white>";
                string colorGrey  = "<color=grey>";
                string colorEnd   = "</color>";

                if (SeamothInfo.seamothLinkModuleIn)
                {
                    colorStartDesc = colorWhite;
                }
                else
                {
                    colorStartDesc = colorGrey;
                }

                GearInfo.temperDisplayText.text = (colorStartDesc + "Water temp" + colorEnd);

                if (ManageAllGUIElements.TemperTextObject != null)
                {
                    ManageAllGUIElements.TemperTextObject.SetActive(true);
                }
            }
            else
            {
                if (ManageAllGUIElements.TemperTextObject != null)
                {
                    ManageAllGUIElements.TemperTextObject.SetActive(false);
                }
            }
        }
Beispiel #4
0
        // Manage Cruise Control text
        internal static void ManageCruiseText()
        {
            if (SeamothInfo.CruiseControlOn && SeamothInfo.electronicModuleIn && SeamothInfo.seamothLinkModuleIn)
            {
                if (ManageAllGUIElements.CruiseSetTextObject == null)
                {
                    ManageAllGUIElements.CruiseSetTextObject = PrepareGUIObjects.PrepareGUIObject("CruiseSetTextUI", GearInfo.cruise_txt_Position);
                }

                // (Object, font size modifier, dual color / gray, is module in, what color if not gray, text type)
                if (ManageAllGUIElements.CruiseSetTextObject != null)
                {
                    ManageAllGUIElements.CruiseSetTextObject = PrepareGUITxt.PrepareTxtElement(ManageAllGUIElements.CruiseSetTextObject, 1.5f, true, SeamothInfo.electronicModuleIn, Color.white, GearInfo.cruise_txt_Position, GearInfo.cruise_txt_Size);
                }

                GearInfo.cruiseDisplayText = ManageAllGUIElements.CruiseSetTextObject.GetComponent <Text>();

                // ("F1") displays 1 decimal place
                if (Config.SeamothGearValue == 5f)
                {
                    GearInfo.cruiseDisplayText.text = GearInfo.colorYellow + Player.main.GetVehicle().forwardForce.ToString("F1") + GearInfo.colorEnd;
                }
                else if (Config.SeamothGearValue == 6f)
                {
                    GearInfo.cruiseDisplayText.text = GearInfo.colorRed + Player.main.GetVehicle().forwardForce.ToString("F1") + GearInfo.colorEnd;
                }
                else
                {
                    GearInfo.cruiseDisplayText.text = Player.main.GetVehicle().forwardForce.ToString("F1");
                }

                if (ManageAllGUIElements.CruiseSetTextObject != null)
                {
                    ManageAllGUIElements.CruiseSetTextObject.SetActive(true);
                }
            }
            else
            {
                if (ManageAllGUIElements.CruiseSetTextObject != null)
                {
                    ManageAllGUIElements.CruiseSetTextObject.SetActive(false);
                }
            }
        }
Beispiel #5
0
        // Manage km/h text
        internal static void ManageKmhText()
        {
            if (ManageAllGUIElements.KmhTextObject == null)
            {
                ManageAllGUIElements.KmhTextObject = PrepareGUIObjects.PrepareGUIObject("KmhTextUI", GearInfo.kmh_txt_Position);
            }

            // (Object, font size modifier, dual color / gray, is module in, what color if not gray, text type)
            if (ManageAllGUIElements.KmhTextObject != null)
            {
                ManageAllGUIElements.KmhTextObject = PrepareGUITxt.PrepareTxtElement(ManageAllGUIElements.KmhTextObject, 1.5f, true, SeamothInfo.mechanicalModuleIn, Color.yellow, GearInfo.kmh_txt_Position, GearInfo.kmh_txt_Size);
            }

            GearInfo.kmhDisplayText = ManageAllGUIElements.KmhTextObject.GetComponent <Text>();

            string colorStart;
            string colorWhite = "<color=white>";
            string colorGrey  = "<color=grey>";
            string colorEnd   = "</color>";

            if (SeamothInfo.mechanicalModuleIn && SeamothInfo.seamothLinkModuleIn)
            {
                colorStart = colorWhite;
            }
            else
            {
                colorStart = colorGrey;
            }

            if (Config.ShowSpeedKmhToggleValue)
            {
                GearInfo.kmhDisplayText.text = (colorStart + "km/h" + colorEnd);
            }
            else
            {
                GearInfo.kmhDisplayText.text = (colorStart + "nm/h" + colorEnd);
            }

            if (ManageAllGUIElements.KmhTextObject != null)
            {
                ManageAllGUIElements.KmhTextObject.SetActive(true);
            }
        }
        // Manage Background icon
        internal static void ManageBackground()
        {
            if (SeamothInfo.electricalModuleIn || SeamothInfo.electronicModuleIn || SeamothInfo.mechanicalModuleIn)
            {
                if (ManageAllGUIElements.BackgroundUIGameObject == null)
                {
                    ManageAllGUIElements.BackgroundUIGameObject = PrepareGUIObjects.PrepareGUIObject("BackgroundUI", GearInfo.gear_txt_Position);
                }

                if (ManageAllGUIElements.BackgroundUIGameObject != null)
                {
                    ManageAllGUIElements.BackgroundUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.BackgroundUIGameObject, "background_343x104", GearInfo.background_Position, GearInfo.background_Size);
                }

                if (ManageAllGUIElements.BackgroundUIGameObject != null)
                {
                    ManageAllGUIElements.BackgroundUIGameObject.SetActive(true);
                }
            }
        }
        // Manage speedometer text
        internal static void ManageSpeedText()
        {
            string colorGrey = "<color=grey>";
            string colorEnd  = "</color>";

            if (ManageAllGUIElements.SpeedNowTextObject == null)
            {
                ManageAllGUIElements.SpeedNowTextObject = PrepareGUIObjects.PrepareGUIObject("SpeedNowTextUI", GearInfo.speed_txt_Position);
            }

            if (ManageAllGUIElements.SpeedNowTextObject != null)
            {
                ManageAllGUIElements.SpeedNowTextObject = PrepareGUITxt.PrepareTxtElement(ManageAllGUIElements.SpeedNowTextObject, 0.65f, true, SeamothInfo.mechanicalModuleIn, Color.white, GearInfo.speed_txt_Position, GearInfo.speed_txt_Size);
            }

            GearInfo.speedDisplayText = ManageAllGUIElements.SpeedNowTextObject.GetComponent <Text>();

            if (SeamothInfo.mechanicalModuleIn && SeamothInfo.seamothLinkModuleIn)
            {
                if (Config.ShowSpeedKmhToggleValue)
                {
                    GearInfo.speedDisplayText.text = Mathf.RoundToInt(Player.main.GetVehicle().useRigidbody.velocity.magnitude).ToString();
                }
                else
                {
                    GearInfo.speedDisplayText.text = Mathf.RoundToInt(Player.main.GetVehicle().useRigidbody.velocity.magnitude / 1.852f).ToString();
                }
            }
            else
            {
                GearInfo.speedDisplayText.text = colorGrey + "-" + colorEnd;
            }

            if (ManageAllGUIElements.SpeedNowTextObject != null)
            {
                ManageAllGUIElements.SpeedNowTextObject.SetActive(true);
            }
        }
        // Manage gears text
        internal static void ManageGearText()
        {
            string colorGrey = "<color=grey>";
            string colorEnd  = "</color>";

            if (ManageAllGUIElements.GearTextObject == null)
            {
                ManageAllGUIElements.GearTextObject = PrepareGUIObjects.PrepareGUIObject("GearTextUI", GearInfo.gear_txt_Position);
            }

            // (Object, font size modifier, dual color / gray, is module in, what color if not gray, text type)
            if (ManageAllGUIElements.GearTextObject != null)
            {
                ManageAllGUIElements.GearTextObject = PrepareGUITxt.PrepareTxtElement(ManageAllGUIElements.GearTextObject, 1.5f, true, SeamothInfo.mechanicalModuleIn, Color.white, GearInfo.gear_txt_Position, GearInfo.gear_txt_Size);
            }

            GearInfo.gearDisplayText = ManageAllGUIElements.GearTextObject.GetComponent <Text>();

            string gearTxt;

            if (SeamothInfo.mechanicalModuleIn && SeamothInfo.seamothLinkModuleIn)
            {
                gearTxt = Config.SeamothGearValue.ToString();
            }
            else
            {
                gearTxt = colorGrey + Config.SeamothGearValue.ToString() + colorEnd;
            }

            GearInfo.gearDisplayText.text = gearTxt; // + "(" + Player.main.GetVehicle().forwardForce.ToString() + ")"; // for checking forward force

            if (ManageAllGUIElements.GearTextObject != null)
            {
                ManageAllGUIElements.GearTextObject.SetActive(true);
            }
        }
Beispiel #9
0
        // Manage Seamoth engine Mode icons
        internal static void ManageMode() // Seamoth energy saving mode on
        {
            if (SeamothInfo.electronicModuleIn && SeamothInfo.seamothLinkModuleIn)
            {
                if (SeamothInfo.ModeGreenOn)
                {
                    if (ManageAllGUIElements.ModeGrayUIGameObject != null)
                    {
                        ManageAllGUIElements.ModeGrayUIGameObject.SetActive(false);
                    }
                    if (ManageAllGUIElements.ModeTurboUIGameObject != null)
                    {
                        ManageAllGUIElements.ModeTurboUIGameObject.SetActive(false);
                    }

                    if (ManageAllGUIElements.ModeGreenUIGameObject == null)
                    {
                        ManageAllGUIElements.ModeGreenUIGameObject = PrepareGUIObjects.PrepareGUIObject("ModeGreenUI", GearInfo.mode_Position);
                    }
                    if (ManageAllGUIElements.ModeGreenUIGameObject != null)
                    {
                        ManageAllGUIElements.ModeGreenUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.ModeGreenUIGameObject, "mode_green_100x100", GearInfo.mode_Position, GearInfo.mode_Size);
                    }

                    if (ManageAllGUIElements.ModeGreenUIGameObject != null)
                    {
                        ManageAllGUIElements.ModeGreenUIGameObject.SetActive(true);
                    }
                }
                else // Seamoth turbo mode on
                {
                    if (ManageAllGUIElements.ModeGrayUIGameObject != null)
                    {
                        ManageAllGUIElements.ModeGrayUIGameObject.SetActive(false);
                    }
                    if (ManageAllGUIElements.ModeGreenUIGameObject != null)
                    {
                        ManageAllGUIElements.ModeGreenUIGameObject.SetActive(false);
                    }

                    if (ManageAllGUIElements.ModeTurboUIGameObject == null)
                    {
                        ManageAllGUIElements.ModeTurboUIGameObject = PrepareGUIObjects.PrepareGUIObject("ModeTurboUI", GearInfo.mode_Position);
                    }
                    if (ManageAllGUIElements.ModeTurboUIGameObject != null)
                    {
                        ManageAllGUIElements.ModeTurboUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.ModeTurboUIGameObject, "mode_turbo_100x100", GearInfo.mode_Position, GearInfo.mode_Size);
                    }

                    if (ManageAllGUIElements.ModeTurboUIGameObject != null)
                    {
                        ManageAllGUIElements.ModeTurboUIGameObject.SetActive(true);
                    }
                }
            }
            else
            {
                if (ManageAllGUIElements.ModeGreenUIGameObject != null)
                {
                    ManageAllGUIElements.ModeGreenUIGameObject.SetActive(false);
                }
                if (ManageAllGUIElements.ModeTurboUIGameObject != null)
                {
                    ManageAllGUIElements.ModeTurboUIGameObject.SetActive(false);
                }

                if (ManageAllGUIElements.ModeGrayUIGameObject == null)
                {
                    ManageAllGUIElements.ModeGrayUIGameObject = PrepareGUIObjects.PrepareGUIObject("ModeGrayUI", GearInfo.mode_Position);
                }
                if (ManageAllGUIElements.ModeGrayUIGameObject != null)
                {
                    ManageAllGUIElements.ModeGrayUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.ModeGrayUIGameObject, "mode_gray_100x100", GearInfo.mode_Position, GearInfo.mode_Size);
                }

                if (ManageAllGUIElements.ModeGrayUIGameObject != null)
                {
                    ManageAllGUIElements.ModeGrayUIGameObject.SetActive(true);
                }
            }
        }
        // Manage Cruise Control icons
        internal static void ManageCruiseControl()
        {
            if (SeamothInfo.electronicModuleIn && SeamothInfo.seamothLinkModuleIn)
            {
                if (SeamothInfo.CruiseControlOn)
                {
                    if (ManageAllGUIElements.CruiseGrayUIGameObject != null)
                    {
                        ManageAllGUIElements.CruiseGrayUIGameObject.SetActive(false);
                    }
                    if (ManageAllGUIElements.CruiseOffUIGameObject != null)
                    {
                        ManageAllGUIElements.CruiseOffUIGameObject.SetActive(false);
                    }

                    if (ManageAllGUIElements.CruiseOnUIGameObject == null)
                    {
                        ManageAllGUIElements.CruiseOnUIGameObject = PrepareGUIObjects.PrepareGUIObject("CruiseOnUI", GearInfo.cruise_Position);
                    }
                    if (ManageAllGUIElements.CruiseOnUIGameObject != null)
                    {
                        ManageAllGUIElements.CruiseOnUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.CruiseOnUIGameObject, "cruise_control_on_100x100", GearInfo.cruise_Position, GearInfo.cruise_Size);
                    }

                    if (ManageAllGUIElements.CruiseOnUIGameObject != null)
                    {
                        ManageAllGUIElements.CruiseOnUIGameObject.SetActive(true);
                    }
                }
                else
                {
                    if (ManageAllGUIElements.CruiseGrayUIGameObject != null)
                    {
                        ManageAllGUIElements.CruiseGrayUIGameObject.SetActive(false);
                    }
                    if (ManageAllGUIElements.CruiseOnUIGameObject != null)
                    {
                        ManageAllGUIElements.CruiseOnUIGameObject.SetActive(false);
                    }

                    if (ManageAllGUIElements.CruiseOffUIGameObject == null)
                    {
                        ManageAllGUIElements.CruiseOffUIGameObject = PrepareGUIObjects.PrepareGUIObject("CruiseOffUI", GearInfo.cruise_Position);
                    }
                    if (ManageAllGUIElements.CruiseOffUIGameObject != null)
                    {
                        ManageAllGUIElements.CruiseOffUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.CruiseOffUIGameObject, "cruise_control_off_100x100", GearInfo.cruise_Position, GearInfo.cruise_Size);
                    }

                    if (ManageAllGUIElements.CruiseOffUIGameObject != null)
                    {
                        ManageAllGUIElements.CruiseOffUIGameObject.SetActive(true);
                    }
                }
            }
            else
            {
                if (ManageAllGUIElements.CruiseOffUIGameObject != null)
                {
                    ManageAllGUIElements.CruiseOffUIGameObject.SetActive(false);
                }
                if (ManageAllGUIElements.CruiseOnUIGameObject != null)
                {
                    ManageAllGUIElements.CruiseOnUIGameObject.SetActive(false);
                }

                if (ManageAllGUIElements.CruiseGrayUIGameObject == null)
                {
                    ManageAllGUIElements.CruiseGrayUIGameObject = PrepareGUIObjects.PrepareGUIObject("CruiseGrayUI", GearInfo.cruise_Position);
                }
                if (ManageAllGUIElements.CruiseGrayUIGameObject != null)
                {
                    ManageAllGUIElements.CruiseGrayUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.CruiseGrayUIGameObject, "cruise_control_gray_100x100", GearInfo.cruise_Position, GearInfo.cruise_Size);
                }

                if (ManageAllGUIElements.CruiseGrayUIGameObject != null)
                {
                    ManageAllGUIElements.CruiseGrayUIGameObject.SetActive(true);
                }
            }
        }
        internal static void ManageBattery()
        {
            if (SeamothInfo.electricalModuleIn && SeamothInfo.seamothLinkModuleIn)
            {
                // display active battery slot
                if (ManageAllGUIElements.BatterySlotGrayUIGameObject != null)
                {
                    ManageAllGUIElements.BatterySlotGrayUIGameObject.SetActive(false);
                }

                if (ManageAllGUIElements.BatterySlotUIGameObject == null)
                {
                    ManageAllGUIElements.BatterySlotUIGameObject = PrepareGUIObjects.PrepareGUIObject("BatterySlotUI", GearInfo.battery_Position);
                }
                if (ManageAllGUIElements.BatterySlotUIGameObject != null)
                {
                    ManageAllGUIElements.BatterySlotUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.BatterySlotUIGameObject, "battery_slot_100x100", GearInfo.battery_Position, GearInfo.battery_Size);
                }

                if (ManageAllGUIElements.BatterySlotUIGameObject != null)
                {
                    ManageAllGUIElements.BatterySlotUIGameObject.SetActive(true);
                }

                // display inserted battery
                if (SeamothInfo.BatteryInSlot == 1) // battery in the slot
                {
                    if (ManageAllGUIElements.BatteryUnitUIGameObject == null)
                    {
                        ManageAllGUIElements.BatteryUnitUIGameObject = PrepareGUIObjects.PrepareGUIObject("BatteryUnitUI", GearInfo.battery_Position);
                    }
                    if (ManageAllGUIElements.BatteryUnitUIGameObject != null)
                    {
                        ManageAllGUIElements.BatteryUnitUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.BatteryUnitUIGameObject, "battery_unit_100x100", GearInfo.battery_Position, GearInfo.battery_Size);
                    }

                    if (ManageAllGUIElements.BatteryUnitUIGameObject != null)
                    {
                        ManageAllGUIElements.BatteryUnitUIGameObject.SetActive(true);
                    }
                }
                else // battery NOT in the slot
                {
                    if (ManageAllGUIElements.BatteryUnitUIGameObject != null)
                    {
                        ManageAllGUIElements.BatteryUnitUIGameObject.SetActive(false);
                    }
                }

                // display battery swap arrows
                // no batteries in inventory
                if (SeamothInfo.TotalBatteryCount == 0) // No batteries - hide all battery arrows
                {
                    if (ManageAllGUIElements.BatteryArrowsUIGameObject != null)
                    {
                        ManageAllGUIElements.BatteryArrowsUIGameObject.SetActive(false);
                    }
                    if (ManageAllGUIElements.BatteryInUIGameObject != null)
                    {
                        ManageAllGUIElements.BatteryInUIGameObject.SetActive(false);
                    }
                    if (ManageAllGUIElements.BatteryOutUIGameObject != null)
                    {
                        ManageAllGUIElements.BatteryOutUIGameObject.SetActive(false);
                    }
                }
                else if (SeamothInfo.TotalBatteryCount == 1) // There is only one battery
                {
                    // Battery is in the slot, display only arrow OUT
                    if (SeamothInfo.BatteryInSlot == 1) // battery is in the slot but not in inventory, display arrow OUT
                    {
                        ManageBatteryHelpers.BatteryShowOut();
                    }
                    else // Battery is in inventory, display only arrow IN
                    {
                        ManageBatteryHelpers.BatteryShowIn();
                    }
                }
                else // There is more than one battery
                {
                    if (SeamothInfo.BatteryInSlot == 1) // Battery is in the slot, display DOUBLE arrow
                    {
                        ManageBatteryHelpers.BatteryShowArrows();
                    }
                    else // Battery is in storage, display only arrow IN
                    {
                        ManageBatteryHelpers.BatteryShowIn();
                    }
                }
            }
            else
            {
                // display inactive battery slot
                if (ManageAllGUIElements.BatterySlotUIGameObject != null)
                {
                    ManageAllGUIElements.BatterySlotUIGameObject.SetActive(false);
                }

                if (ManageAllGUIElements.BatterySlotGrayUIGameObject == null)
                {
                    ManageAllGUIElements.BatterySlotGrayUIGameObject = PrepareGUIObjects.PrepareGUIObject("BatterySlotGrayUI", GearInfo.battery_Position);
                }
                if (ManageAllGUIElements.BatterySlotGrayUIGameObject != null)
                {
                    ManageAllGUIElements.BatterySlotGrayUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.BatterySlotGrayUIGameObject, "battery_slot_gray_100x100", GearInfo.battery_Position, GearInfo.battery_Size);
                }

                if (ManageAllGUIElements.BatterySlotGrayUIGameObject != null)
                {
                    ManageAllGUIElements.BatterySlotGrayUIGameObject.SetActive(true);
                }
            }
        }
Beispiel #12
0
        // Manage Lights icons
        internal static void ManageLights()
        {
            if (SeamothInfo.electricalModuleIn && SeamothInfo.seamothLinkModuleIn)
            {
                Vehicle      thisSeamoth      = (Player.main.GetVehicle() as SeaMoth);
                ToggleLights thisToggleLights = thisSeamoth.GetComponentInChildren <ToggleLights>();
                bool         LightsAreOn      = false;
                if (thisToggleLights != null)
                {
                    LightsAreOn = thisToggleLights.GetLightsActive();
                }

                if (!LightsAreOn)                         // lights are off
                {
                    if (!Vehicle_Update_Patch.HighBeamOn) // low beam on
                    {
                        if (ManageAllGUIElements.LightGrayUIGameObject != null)
                        {
                            ManageAllGUIElements.LightGrayUIGameObject.SetActive(false);
                        }
                        if (ManageAllGUIElements.LightLowOnUIGameObject != null)
                        {
                            ManageAllGUIElements.LightLowOnUIGameObject.SetActive(false);
                        }
                        if (ManageAllGUIElements.LightHighOffUIGameObject != null)
                        {
                            ManageAllGUIElements.LightHighOffUIGameObject.SetActive(false);
                        }
                        if (ManageAllGUIElements.LightHighOnUIGameObject != null)
                        {
                            ManageAllGUIElements.LightHighOnUIGameObject.SetActive(false);
                        }

                        if (ManageAllGUIElements.LightLowOffUIGameObject == null)
                        {
                            ManageAllGUIElements.LightLowOffUIGameObject = PrepareGUIObjects.PrepareGUIObject("LightLowOffUI", GearInfo.light_Position);
                        }
                        if (ManageAllGUIElements.LightLowOffUIGameObject != null)
                        {
                            ManageAllGUIElements.LightLowOffUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.LightLowOffUIGameObject, "light_low_off_100x100", GearInfo.light_Position, GearInfo.light_Size);
                        }

                        if (ManageAllGUIElements.LightLowOffUIGameObject != null)
                        {
                            ManageAllGUIElements.LightLowOffUIGameObject.SetActive(true);
                        }
                    }
                    else // high beam on
                    {
                        if (ManageAllGUIElements.LightGrayUIGameObject != null)
                        {
                            ManageAllGUIElements.LightGrayUIGameObject.SetActive(false);
                        }
                        if (ManageAllGUIElements.LightHighOnUIGameObject != null)
                        {
                            ManageAllGUIElements.LightHighOnUIGameObject.SetActive(false);
                        }
                        if (ManageAllGUIElements.LightLowOffUIGameObject != null)
                        {
                            ManageAllGUIElements.LightLowOffUIGameObject.SetActive(false);
                        }
                        if (ManageAllGUIElements.LightLowOnUIGameObject != null)
                        {
                            ManageAllGUIElements.LightLowOnUIGameObject.SetActive(false);
                        }

                        if (ManageAllGUIElements.LightHighOffUIGameObject == null)
                        {
                            ManageAllGUIElements.LightHighOffUIGameObject = PrepareGUIObjects.PrepareGUIObject("LightHighOffUI", GearInfo.light_Position);
                        }
                        if (ManageAllGUIElements.LightHighOffUIGameObject != null)
                        {
                            ManageAllGUIElements.LightHighOffUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.LightHighOffUIGameObject, "light_high_off_100x100", GearInfo.light_Position, GearInfo.light_Size);
                        }

                        if (ManageAllGUIElements.LightHighOffUIGameObject != null)
                        {
                            ManageAllGUIElements.LightHighOffUIGameObject.SetActive(true);
                        }
                    }
                }
                else // lights are on
                {
                    if (!Vehicle_Update_Patch.HighBeamOn) // low beam on
                    {
                        if (ManageAllGUIElements.LightGrayUIGameObject != null)
                        {
                            ManageAllGUIElements.LightGrayUIGameObject.SetActive(false);
                        }
                        if (ManageAllGUIElements.LightHighOffUIGameObject != null)
                        {
                            ManageAllGUIElements.LightHighOffUIGameObject.SetActive(false);
                        }
                        if (ManageAllGUIElements.LightHighOnUIGameObject != null)
                        {
                            ManageAllGUIElements.LightHighOnUIGameObject.SetActive(false);
                        }
                        if (ManageAllGUIElements.LightLowOffUIGameObject != null)
                        {
                            ManageAllGUIElements.LightLowOffUIGameObject.SetActive(false);
                        }

                        if (ManageAllGUIElements.LightLowOnUIGameObject == null)
                        {
                            ManageAllGUIElements.LightLowOnUIGameObject = PrepareGUIObjects.PrepareGUIObject("LightLowOnUI", GearInfo.light_Position);
                        }
                        if (ManageAllGUIElements.LightLowOnUIGameObject != null)
                        {
                            ManageAllGUIElements.LightLowOnUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.LightLowOnUIGameObject, "light_low_on_100x100", GearInfo.light_Position, GearInfo.light_Size);
                        }

                        if (ManageAllGUIElements.LightLowOnUIGameObject != null)
                        {
                            ManageAllGUIElements.LightLowOnUIGameObject.SetActive(true);
                        }
                    }
                    else // high beam on
                    {
                        if (ManageAllGUIElements.LightGrayUIGameObject != null)
                        {
                            ManageAllGUIElements.LightGrayUIGameObject.SetActive(false);
                        }
                        if (ManageAllGUIElements.LightLowOffUIGameObject != null)
                        {
                            ManageAllGUIElements.LightLowOffUIGameObject.SetActive(false);
                        }
                        if (ManageAllGUIElements.LightLowOnUIGameObject != null)
                        {
                            ManageAllGUIElements.LightLowOnUIGameObject.SetActive(false);
                        }
                        if (ManageAllGUIElements.LightHighOffUIGameObject != null)
                        {
                            ManageAllGUIElements.LightHighOffUIGameObject.SetActive(false);
                        }

                        if (ManageAllGUIElements.LightHighOnUIGameObject == null)
                        {
                            ManageAllGUIElements.LightHighOnUIGameObject = PrepareGUIObjects.PrepareGUIObject("LightHighOnUI", GearInfo.light_Position);
                        }
                        if (ManageAllGUIElements.LightHighOnUIGameObject != null)
                        {
                            ManageAllGUIElements.LightHighOnUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.LightHighOnUIGameObject, "light_high_on_100x100", GearInfo.light_Position, GearInfo.light_Size);
                        }

                        if (ManageAllGUIElements.LightHighOnUIGameObject != null)
                        {
                            ManageAllGUIElements.LightHighOnUIGameObject.SetActive(true);
                        }
                    }
                }
            }
            else
            {
                if (ManageAllGUIElements.LightLowOnUIGameObject != null)
                {
                    ManageAllGUIElements.LightLowOnUIGameObject.SetActive(false);
                }
                if (ManageAllGUIElements.LightLowOffUIGameObject != null)
                {
                    ManageAllGUIElements.LightLowOffUIGameObject.SetActive(false);
                }
                if (ManageAllGUIElements.LightHighOffUIGameObject != null)
                {
                    ManageAllGUIElements.LightHighOffUIGameObject.SetActive(false);
                }
                if (ManageAllGUIElements.LightHighOnUIGameObject != null)
                {
                    ManageAllGUIElements.LightHighOnUIGameObject.SetActive(false);
                }

                if (ManageAllGUIElements.LightGrayUIGameObject == null)
                {
                    ManageAllGUIElements.LightGrayUIGameObject = PrepareGUIObjects.PrepareGUIObject("LightGrayUI", GearInfo.light_Position);
                }
                if (ManageAllGUIElements.LightGrayUIGameObject != null)
                {
                    ManageAllGUIElements.LightGrayUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.LightGrayUIGameObject, "light_gray_100x100", GearInfo.light_Position, GearInfo.light_Size);
                }

                if (ManageAllGUIElements.LightGrayUIGameObject != null)
                {
                    ManageAllGUIElements.LightGrayUIGameObject.SetActive(true);
                }
            }
        }
Beispiel #13
0
        // Manage gears icons and text
        internal static void ManageGears()
        {
            if (SeamothInfo.mechanicalModuleIn && SeamothInfo.seamothLinkModuleIn)
            {
                if (Config.SeamothGearValue == 6f)
                {
                    if (ManageAllGUIElements.CogsGrayUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsGrayUIGameObject.SetActive(false);
                    }
                    if (ManageAllGUIElements.CogsBlueUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsBlueUIGameObject.SetActive(false);
                    }
                    if (ManageAllGUIElements.CogsYellowUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsYellowUIGameObject.SetActive(false);
                    }

                    if (ManageAllGUIElements.CogsRedUIGameObject == null)
                    {
                        ManageAllGUIElements.CogsRedUIGameObject = PrepareGUIObjects.PrepareGUIObject("CogsRedUI", GearInfo.cogs_Position);
                    }
                    if (ManageAllGUIElements.CogsRedUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsRedUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.CogsRedUIGameObject, "cogs_red_100x100", GearInfo.cogs_Position, GearInfo.cogs_Size);
                    }

                    if (ManageAllGUIElements.CogsRedUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsRedUIGameObject.SetActive(true);
                    }
                }

                if (Config.SeamothGearValue == 5f)
                {
                    if (ManageAllGUIElements.CogsGrayUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsGrayUIGameObject.SetActive(false);
                    }
                    if (ManageAllGUIElements.CogsBlueUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsBlueUIGameObject.SetActive(false);
                    }
                    if (ManageAllGUIElements.CogsRedUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsRedUIGameObject.SetActive(false);
                    }

                    if (ManageAllGUIElements.CogsYellowUIGameObject == null)
                    {
                        ManageAllGUIElements.CogsYellowUIGameObject = PrepareGUIObjects.PrepareGUIObject("CogsYellowUI", GearInfo.cogs_Position);
                    }
                    if (ManageAllGUIElements.CogsYellowUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsYellowUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.CogsYellowUIGameObject, "cogs_yellow_100x100", GearInfo.cogs_Position, GearInfo.cogs_Size);
                    }

                    if (ManageAllGUIElements.CogsYellowUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsYellowUIGameObject.SetActive(true);
                    }
                }

                if (Config.SeamothGearValue < 5f)
                {
                    if (ManageAllGUIElements.CogsGrayUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsGrayUIGameObject.SetActive(false);
                    }
                    if (ManageAllGUIElements.CogsYellowUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsYellowUIGameObject.SetActive(false);
                    }
                    if (ManageAllGUIElements.CogsRedUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsRedUIGameObject.SetActive(false);
                    }

                    if (ManageAllGUIElements.CogsBlueUIGameObject == null)
                    {
                        ManageAllGUIElements.CogsBlueUIGameObject = PrepareGUIObjects.PrepareGUIObject("CogsBlueUI", GearInfo.cogs_Position);
                    }
                    if (ManageAllGUIElements.CogsBlueUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsBlueUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.CogsBlueUIGameObject, "cogs_blue_100x100", GearInfo.cogs_Position, GearInfo.cogs_Size);
                    }

                    if (ManageAllGUIElements.CogsBlueUIGameObject != null)
                    {
                        ManageAllGUIElements.CogsBlueUIGameObject.SetActive(true);
                    }
                }
            }
            else
            {
                if (ManageAllGUIElements.CogsBlueUIGameObject != null)
                {
                    ManageAllGUIElements.CogsBlueUIGameObject.SetActive(false);
                }
                if (ManageAllGUIElements.CogsYellowUIGameObject != null)
                {
                    ManageAllGUIElements.CogsYellowUIGameObject.SetActive(false);
                }
                if (ManageAllGUIElements.CogsRedUIGameObject != null)
                {
                    ManageAllGUIElements.CogsRedUIGameObject.SetActive(false);
                }

                if (ManageAllGUIElements.CogsGrayUIGameObject == null)
                {
                    ManageAllGUIElements.CogsGrayUIGameObject = PrepareGUIObjects.PrepareGUIObject("CogsGrayUI", GearInfo.cogs_Position);
                }
                if (ManageAllGUIElements.CogsGrayUIGameObject != null)
                {
                    ManageAllGUIElements.CogsGrayUIGameObject = PrepareGUISprite.PrepareGuiElement(ManageAllGUIElements.CogsGrayUIGameObject, "cogs_gray_100x100", GearInfo.cogs_Position, GearInfo.cogs_Size);
                }

                if (ManageAllGUIElements.CogsGrayUIGameObject != null)
                {
                    ManageAllGUIElements.CogsGrayUIGameObject.SetActive(true);
                }
            }
        }