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); } } }
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); } } }
public void OnHandHover(HandTargetEventData data) { HandReticle main = HandReticle.main; main.SetIcon(HandReticle.IconType.Hand, 1f); main.SetText(HandReticle.TextType.Hand, labelInteract, true, GameInput.Button.LeftHand); }
public void OnHandHover(GUIHand hand) { HandReticle main = HandReticle.main; main.SetInteractText(SubnauticaDeathMarker.InteractText); main.SetIcon(HandReticle.IconType.Hand); }
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 } }
private void OnHover(Constructable constructable) { if (isActive) { HandReticle main = HandReticle.main; if (constructable.constructed) { main.SetText(HandReticle.TextType.Hand, this.deconstructText, 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.SetText(HandReticle.TextType.Hand, stringBuilder.ToString(), false); main.SetProgress(constructable.amount); main.SetIcon(HandReticle.IconType.Progress, 1.5f); } } }
// 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); }
public void OnPointerExit() { if (Player.main.currentSub == control_instance.subroot) { HandReticle main = HandReticle.main; main.SetIcon(HandReticle.IconType.Default, 1f); mouseHover = false; } }
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); } }
public virtual void Update() { bool inInteractionRange = InInteractionRange(); if (this.IsHovered && inInteractionRange) { HandReticle main = HandReticle.main; #if SUBNAUTICA if (ButtonMode == InterfaceButtonMode.None) { main.SetIcon(HandReticle.IconType.Hand, 1f); main.SetInteractTextRaw(this.TextLineOne, this.TextLineTwo); } else { main.SetInteractTextRaw(this.TextLineOne, this.TextLineTwo); } #elif BELOWZERO if (ButtonMode == InterfaceButtonMode.None) { main.SetIcon(HandReticle.IconType.Hand, 1f); main.SetTextRaw(HandReticle.TextType.Hand, this.TextLineOne); main.SetTextRaw(HandReticle.TextType.Hand, this.TextLineTwo); } else { main.SetTextRaw(HandReticle.TextType.Hand, this.TextLineOne); main.SetTextRaw(HandReticle.TextType.Hand, this.TextLineTwo); } #endif } if (this.IsHovered && inInteractionRange == false) { this.IsHovered = false; } if (this.IsHovered == false && isHoveredOutOfRange && inInteractionRange) { this.IsHovered = true; } }
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); }
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 bool TryDisplayNoPowerTooltip() { if (this.energyMixin.GetPower() <= 0f) { HandReticle main = HandReticle.main; main.SetText(HandReticle.TextType.Hand, this.noPowerText, false); main.SetIcon(HandReticle.IconType.Default, 1f); return(true); } return(false); }
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); }
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); }
public void OnHandHover(GUIHand guiHand) { if (!Buildable.constructed) { return; } HandReticle main = HandReticle.main; main.SetInteractText(CyUpgradeConsole.OnHoverText); main.SetIcon(HandReticle.IconType.Hand, 1f); }
/// <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); }
public void OnHandHover(GUIHand hand) { if (!WorldInstance.constructed) { return; } HandReticle main = HandReticle.main; main.SetInteractText("UseArmourStand"); main.SetIcon(HandReticle.IconType.Hand, 1f); }
public void OnHandHover(GUIHand hand) { HandReticle main = HandReticle.main; var state = PowerManager?.GetPowerState() == FCSPowerStates.Powered ? "On" : "Off"; #if SUBNAUTICA main.SetInteractTextRaw(Manager?.GetBaseName(), $"{AuxPatchers.Antenna()}: {state} || {AuxPatchers.PowerUsage()}: {PowerManager?.GetPowerUsage():F1}"); #elif BELOWZERO main.SetText(HandReticle.TextType.Info, Manager.GetBaseName(), false); #endif main.SetIcon(HandReticle.IconType.Info, 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); } }
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); }
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 (!_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); }
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 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) { 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 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; } }