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 OnHover() { if (energyMixin.charge <= 0f) { return; } PDAScanner.ScanTarget scanTarget = PDAScanner.scanTarget; PDAScanner.UpdateTarget(scanDistance, false); if (!scanTarget.isValid) { return; } PDAScanner.Result result = PDAScanner.CanScan(); }
public static void Postfix(ScannerTool __instance) { PDAScanner.ScanTarget scanTarget = PDAScanner.scanTarget; #if SN1 PDAScanner.Result result = PDAScanner.CanScan(); #elif BZ PDAScanner.Result result = PDAScanner.CanScan(scanTarget); #endif PDAScanner.EntryData entryData = PDAScanner.GetEntryData(PDAScanner.scanTarget.techType); if ((entryData != null && (CrafterLogic.IsCraftRecipeUnlocked(entryData.blueprint) || CrafterLogic.IsCraftRecipeUnlocked(entryData.key))) || PDAScanner.ContainsCompleteEntry(scanTarget.techType) || __instance.energyMixin.charge <= 0f || !scanTarget.isValid || result != PDAScanner.Result.Scan || !GameModeUtils.RequiresBlueprints()) { return; } #if SN1 HandReticle.main.SetInteractText(Main.config.UnKnownLabel, false, HandReticle.Hand.None); #elif BZ HandReticle.main.SetText(HandReticle.TextType.Hand, Main.config.UnKnownLabel, true, GameInput.Button.None); #endif }