private void Update()
        {
            if (isActive)
            {
                PDAScanner.Result result = Scan();

                if (!isScanning)
                {
                    if (result != PDAScanner.Result.Known)
                    {
                        main.SetInteractText("AutoScan", "Active", false, false, HandReticle.Hand.None);
                        main.SetIcon(HandReticle.IconType.Scan, 1.5f);
                    }
                }
                else
                {
                    main.SetInteractText(PDAScanner.scanTarget.techType.AsString(false), true, HandReticle.Hand.None);
                    main.SetIcon(HandReticle.IconType.Progress, 10f);
                    main.progressText.text = Mathf.RoundToInt(PDAScanner.scanTarget.progress * 100f) + "%";
                    Modules.SetProgressColor(Modules.Colors.Orange);
                    main.progressImage.fillAmount = Mathf.Clamp01(PDAScanner.scanTarget.progress);
                    main.SetProgress(PDAScanner.scanTarget.progress);
                }

                if (idleTimer > 0f)
                {
                    idleTimer = Mathf.Max(0f, idleTimer - Time.deltaTime);
                }
            }
        }
Exemplo n.º 2
0
        public void OnHandHover(GUIHand hand)
        {
            HandReticle reticle = HandReticle.main;

            if (!reticle)
            {
                return;
            }

            EnergyMixin mixin = shark.energyInterface.sources[0];

            if (mixin.HasItem())
            {
                if (mixin.charge > 0f)
                {
                    isValidHandTarget = false;
                    reticle.SetInteractText("Ion Cube", $"{Mathf.Round(mixin.charge / mixin.capacity * 100f)}% Remaining", false, false, HandReticle.Hand.None);
                }
                else
                {
                    isValidHandTarget = true;
                    reticle.SetInteractText("Ion Cube", $"Click to remove", false, false, HandReticle.Hand.Left);
                }
            }
            else
            {
                isValidHandTarget = true;
                reticle.SetInteractText("Insert Ion Cube", false, HandReticle.Hand.Left);
            }
        }
Exemplo n.º 3
0
        //=====================================================================
        // OnHover (Constructable)
        //
        // Displays tooltip text when the player is looking at a constructable
        // object
        //=====================================================================
        private void OnHover(Constructable constructable)
        {
            HandReticle main = HandReticle.main;

            if (constructable.constructed)
            {
                main.SetInteractText(Language.main.Get(constructable.techType), this.deconstructText, false, false, false);
            }
            else
            {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.AppendLine(this.constructText);
                foreach (KeyValuePair <TechType, int> keyValuePair in constructable.GetRemainingResources())
                {
                    TechType key   = keyValuePair.Key;
                    string   text  = Language.main.Get(key);
                    int      value = keyValuePair.Value;
                    if (value > 1)
                    {
                        stringBuilder.AppendLine(Language.main.GetFormat <string, int>("RequireMultipleFormat", text, value));
                    }
                    else
                    {
                        stringBuilder.AppendLine(text);
                    }
                }
                main.SetInteractText(Language.main.Get(constructable.techType), stringBuilder.ToString(), false, false, false);
                main.SetProgress(constructable.amount);
                main.SetIcon(HandReticle.IconType.Progress, 1.5f);
            }
        }
        public void OnHandHover(GUIHand hand)
        {
            if (_mono == null)
            {
                return;
            }

            var         state = _mono.PowerManager.GetPowerState();
            HandReticle main  = HandReticle.main;

#if DEBUG
            main.SetInteractText(SeaCookerBuildable.NoPowerAvailable());
#endif
            //QuickLogger.Debug($"PowerState: {state}");

            if (state == FCSPowerStates.Unpowered)
            {
                main.SetIcon(HandReticle.IconType.Default);
#if SUBNAUTICA
                main.SetInteractText(SeaCookerBuildable.NoPowerAvailable());
#elif BELOWZERO
                main.SetText(HandReticle.TextType.Hand, SeaCookerBuildable.NoPowerAvailable(), false);
#endif
            }
        }
        public void OnHandHover(GUIHand hand)
        {
            HandReticle main = HandReticle.main;

            if (!_hasTank)
            {
                main.SetInteractText(LanguageHelpers.GetLanguage(FEHolderBuildable.OnHandOverEmpty()));
            }
            else
            {
                main.SetInteractText(LanguageHelpers.GetLanguage(FEHolderBuildable.OnHandOverNotEmpty()), $"Fire Extinguisher: {Mathf.RoundToInt(_fuel)}%");
            }

            main.SetIcon(HandReticle.IconType.Hand, 1f);
        }
Exemplo n.º 6
0
        private void OnHover()
        {
            if (energyMixin.charge <= 0f)
            {
                return;
            }

            PDAScanner.ScanTarget scanTarget = PDAScanner.scanTarget;

            PDAScanner.UpdateTarget(scanDistance, false);

            if (!scanTarget.isValid)
            {
                return;
            }

            PDAScanner.Result result = PDAScanner.CanScan();

            if (result == PDAScanner.Result.Scan)
            {
                HandReticle main = HandReticle.main;
                main.SetInteractText(scanTarget.techType.AsString(false), true, HandReticle.Hand.Left);
                main.SetIcon(HandReticle.IconType.Scan, 1.5f);

                if (stateCurrent == ScanState.Scan)
                {
                    main.SetIcon(HandReticle.IconType.Progress, 4f);
                    main.progressText.text = Mathf.RoundToInt(PDAScanner.scanTarget.progress * 100f) + "%";
                    SetProgressColor(Colors.Green);
                    main.progressImage.fillAmount = Mathf.Clamp01(PDAScanner.scanTarget.progress);
                    main.SetProgress(PDAScanner.scanTarget.progress);
                }
            }
        }
        public void OnHandHover(GUIHand hand)
        {
            HandReticle main = HandReticle.main;

            main.SetInteractText(SubnauticaDeathMarker.InteractText);
            main.SetIcon(HandReticle.IconType.Hand);
        }
Exemplo n.º 8
0
 private void OnHover(BaseDeconstructable deconstructable)
 {
     if (isActive)
     {
         HandReticle main = HandReticle.main;
         main.SetInteractText(deconstructable.Name, this.deconstructText);
     }
 }
Exemplo n.º 9
0
        // Completely replaces the original OnHover method in the BaseBioReactor
        internal void OnHover()
        {
            HandReticle main = HandReticle.main;

            // All this is getting updated in Unity 2018
            main.SetInteractText(Language.main.GetFormat("UseBaseBioReactor", this.CurrentPower, this.MaxPowerText), "Tooltip_UseBaseBioReactor", false, true, true);
            main.SetIcon(HandReticle.IconType.Hand, 1f);
        }
Exemplo n.º 10
0
 private void Update()
 {
     if (mouseHover)
     {
         HandReticle main = HandReticle.main;
         main.SetInteractText(CannonConfig.language_settings["Item_Name"]);
     }
 }
Exemplo n.º 11
0
 public void OnHandHover(GUIHand hand)
 {
     if (base.enabled)
     {
         HandReticle main = HandReticle.main;
         main.SetIcon(HandReticle.IconType.Hand, 1f);
         main.SetInteractText(m_UseSystemTime ? k_SetGameTime : k_SetSystemTime);
     }
 }
Exemplo n.º 12
0
        public void OnHandHover(GUIHand hand)
        {
            HandReticle main = HandReticle.main;

            main.SetIcon(HandReticle.IconType.Default);
#if SUBNAUTICA
            main.SetInteractText(_mono.PowerManager.GetSolarPowerData(), false, HandReticle.Hand.None);
#elif BELOWZERO
            main.SetText(HandReticle.TextType.Hand, _mono.PowerManager.GetSolarPowerData(), false);
#endif
        }
        public void OnHandHover(GUIHand hand)
        {
            HandReticle main = HandReticle.main;

#if SUBNAUTICA
            main.SetInteractText("Climb Ladder");
#elif BELOWZERO
            main.SetText(HandReticle.TextType.Hand, "Climb Ladder", false);
#endif
            main.SetIcon(HandReticle.IconType.Hand, 1f);
        }
Exemplo n.º 14
0
 private bool TryDisplayNoPowerTooltip()
 {
     if (this.energyMixin.charge <= 0f)
     {
         HandReticle main = HandReticle.main;
         main.SetInteractText(this.noPowerText, false, HandReticle.Hand.None);
         main.SetIcon(HandReticle.IconType.Default, 1f);
         return(true);
     }
     return(false);
 }
Exemplo n.º 15
0
        public void OnHandHover(GUIHand guiHand)
        {
            if (!Buildable.constructed)
            {
                return;
            }

            HandReticle main = HandReticle.main;

            if (OverLimit)
            {
                main.SetInteractText(CyBioReactor.OverLimitString());
            }
            else
            {
                main.SetInteractText(CyBioReactor.OnHoverFormatString(Mathf.FloorToInt(Battery._charge), Battery._capacity, (this.MaterialsProcessing.Count > 0 ? "+" : "")));
            }

            main.SetIcon(HandReticle.IconType.Hand, 1f);
        }
        public void OnHandHover(GUIHand hand)
        {
            HandReticle main = HandReticle.main;

#if SUBNAUTICA
            main.SetInteractText(FCSDeepDrillerBuildable.OnBatteryHoverText());
#elif BELOWZERO
            main.SetText(HandReticle.TextType.Hand, FCSDeepDrillerBuildable.OnBatteryHoverText(), false);
#endif
            main.SetIcon(HandReticle.IconType.Hand, 1f);
        }
        public void OnHandHover(GUIHand hand)
        {
            HandReticle main = HandReticle.main;

#if SUBNAUTICA
            main.SetInteractText(AIPowerCellSocketBuildable.OnHover());
#elif BELOWZERO
            main.SetText(HandReticle.TextType.Hand, AIPowerCellSocketBuildable.OnHover(), false);
#endif
            main.SetIcon(HandReticle.IconType.Hand, 1f);
        }
        public void OnHandHover(GUIHand hand)
        {
            HandReticle main = HandReticle.main;

#if SUBNAUTICA
            main.SetInteractText("Open MedBay Storage.");
#elif BELOWZERO
            main.SetText(HandReticle.TextType.Hand, "Open MedBay Storage.", false);
#endif
            main.SetIcon(HandReticle.IconType.Hand, 1f);
        }
        private void OnHover(BaseDeconstructable deconstructable)
        {
            if (isActive)
            {
                HandReticle main = HandReticle.main;
#if SN1
                main.SetInteractText(deconstructable.Name, deconstructText);
#elif BZ
                main.SetText(HandReticle.TextType.Hand, this.deconstructText, false);
#endif
            }
        }
Exemplo n.º 20
0
        public void OnHandHover(GUIHand guiHand)
        {
            if (!Buildable.constructed)
            {
                return;
            }

            HandReticle main = HandReticle.main;

            main.SetInteractText(CyUpgradeConsole.OnHoverText);
            main.SetIcon(HandReticle.IconType.Hand, 1f);
        }
Exemplo n.º 21
0
        /// <summary>
        /// Called when the player hovers over the upgrade console.
        /// </summary>
        /// <param name="guiHand">The GUI hand.</param>
        /// <see cref="IHandTarget"/>
        public virtual void OnHandHover(GUIHand guiHand)
        {
            if (!this.Buildable.constructed)
            {
                return;
            }

            HandReticle main = HandReticle.main;

            main.SetInteractText(this.OnHoverText);
            main.SetIcon(HandReticle.IconType.Hand, 1f);
        }
Exemplo n.º 22
0
        public void OnHandHover(GUIHand hand)
        {
            if (!WorldInstance.constructed)
            {
                return;
            }

            HandReticle main = HandReticle.main;

            main.SetInteractText("UseArmourStand");
            main.SetIcon(HandReticle.IconType.Hand, 1f);
        }
        // Completely replaces the original OnHover method in the BaseBioReactor
        internal void OnHover()
        {
            HandReticle main = HandReticle.main;

            string text1 = Language.main.GetFormat("UseBaseBioReactor", this.CurrentPower, this.MaxPowerText);

#if SUBNAUTICA
            main.SetInteractText(text1, "Tooltip_UseBaseBioReactor", false, true, HandReticle.Hand.Right);
#elif BELOWZERO
            main.SetText(HandReticle.TextType.Hand, text1, false, GameInput.Button.LeftHand);
            main.SetText(HandReticle.TextType.HandSubscript, "Tooltip_UseBaseBioReactor", true);
#endif
            main.SetIcon(HandReticle.IconType.Hand, 1f);
        }
        public void OnHandHover(GUIHand hand)
        {
            if (_mono == null)
            {
                return;
            }

            if (ShowBeaconMessage())
            {
                HandReticle main = HandReticle.main;
                main.SetIcon(HandReticle.IconType.Hand);
                main.SetInteractText($"Click to attach beacon", false, HandReticle.Hand.Right);
            }
        }
        private bool TryDisplayNoPowerTooltip()
        {
            if (this.EnergyMixin.charge <= 0f)
            {
                HandReticle main = HandReticle.main;
#if SN1
                main.SetInteractText(noPowerText, false, HandReticle.Hand.None);
#elif BZ
                main.SetText(HandReticle.TextType.Hand, this.noPowerText, true);
#endif
                main.SetIcon(HandReticle.IconType.Default, 1f);
                return(true);
            }
            return(false);
        }
        public void OnHandHover(GUIHand hand)
        {
            if (_mono == null)
            {
                return;
            }

            if (TeleportManager.IsTeleporting())
            {
                return;
            }

            HandReticle main = HandReticle.main;

            main.SetIcon(HandReticle.IconType.Hand);

#if SUBNAUTICA
            if (!IsDoorOpen())
            {
                main.SetInteractText(QuantumTeleporterBuildable.OpenDoor());
            }
            else
            {
                main.SetInteractText(QuantumTeleporterBuildable.CloseDoor());
            }
#elif BELOWZERO
            if (!IsDoorOpen())
            {
                main.SetText(HandReticle.TextType.Hand, QuantumTeleporterBuildable.OpenDoor(), false);
            }
            else
            {
                main.SetText(HandReticle.TextType.Hand, QuantumTeleporterBuildable.CloseDoor(), false);
            }
#endif
        }
        public void OnHandHover(GUIHand hand)
        {
            if (!_buildable.constructed)
            {
                return;
            }

            HandReticle main = HandReticle.main;

            int currentPower = Mathf.CeilToInt(GetTotalAvailablePower());

            string text = currentPower > 0
                ? CyNukReactorBuildable.OnHoverPoweredText(NumberFormatter.FormatValue(currentPower), this.ActiveRodCount, this.MaxActiveSlots)
                : CyNukReactorBuildable.OnHoverNoPowerText();

            main.SetInteractText(text);
            main.SetIcon(HandReticle.IconType.Hand, 1f);
        }
Exemplo n.º 28
0
        static bool Prefix(BuilderTool __instance, Constructable constructable)
        {
            if (!constructable.gameObject.GetComponent <DebrisDeconstructable>())
            {
                return(true);
            }

            HandReticle hand = HandReticle.main;

            hand.SetInteractText(L10n.str("ids_salvageableDebris"), __instance.deconstructText, false, false, HandReticle.Hand.None);

            if (!constructable.constructed)
            {
                hand.SetProgress(constructable.amount);
                hand.SetIcon(HandReticle.IconType.Progress, 1.5f);
            }

            return(false);
        }
        public void Update()
        {
            if (!isActive)
            {
                return;
            }

            else if (thisVehicle.liveMixin.health < thisVehicle.liveMixin.maxHealth && energyMixin.charge > energyMixin.capacity * 0.1f)
            {
                weldSound.Play();
                energyMixin.ConsumeEnergy(powerConsumption * Time.deltaTime);
                main.SetIcon(HandReticle.IconType.Progress, 1.5f);
                thisVehicle.liveMixin.health += Time.deltaTime * repairPerSec;
                main.SetInteractText("Repairing...", false, HandReticle.Hand.None);

                if (thisVehicle.liveMixin.health < thisVehicle.liveMixin.maxHealth * 0.5f)
                {
                    SetProgressColor(Color.red);
                    SetInteractColor(Color.red);
                }
                else if (thisVehicle.liveMixin.health < thisVehicle.liveMixin.maxHealth * 0.75f && thisVehicle.liveMixin.health > thisVehicle.liveMixin.maxHealth * 0.5f)
                {
                    SetProgressColor(Color.yellow);
                    SetInteractColor(Color.yellow);
                }
                else if (thisVehicle.liveMixin.health > thisVehicle.liveMixin.maxHealth * 0.75f)
                {
                    SetProgressColor(Color.green);
                    SetInteractColor(Color.green);
                }

                main.SetProgress(thisVehicle.liveMixin.health / thisVehicle.liveMixin.maxHealth);

                if (thisVehicle.liveMixin.health >= thisVehicle.liveMixin.maxHealth)
                {
                    thisVehicle.liveMixin.health = thisVehicle.liveMixin.maxHealth;
                    thisVehicle.SlotKeyDown(moduleSlotID);
                    return;
                }
            }
            else if (energyMixin.charge <= energyMixin.capacity * 0.1f)
            {
                if (idleTimer > 0f)
                {
                    weldSound.Stop();
                    idleTimer = Mathf.Max(0f, idleTimer - Time.deltaTime);
                    SetInteractColor(Color.red);
                    main.SetInteractText("Warning!\nLow Power!", "Repair Module Disabled!", false, false, HandReticle.Hand.None);
                }
                else
                {
                    idleTimer = 3f;
                    thisVehicle.SlotKeyDown(moduleSlotID);
                    return;
                }
            }
            else if (thisVehicle.liveMixin.health == thisVehicle.liveMixin.maxHealth)
            {
                thisVehicle.SlotKeyDown(moduleSlotID);
                return;
            }
        }