public static void Postfix(IList <Ingredient> ingredients, ref List <TooltipIcon> icons) { if (ingredients == null) { return; } var ingredientCount = ingredients.Count; for (var i = 0; i < ingredientCount; i++) { var techType = ingredients[i].techType; if (!KnownTech.Contains(techType) && PDAScanner.ContainsCompleteEntry(techType)) { KnownTech.Add(techType); } if (KnownTech.Contains(techType) || !GameModeUtils.RequiresBlueprints()) { continue; } var icon = icons.Find((TooltipIcon) => TooltipIcon.sprite == SpriteManager.Get(techType) && TooltipIcon.text.Contains(Language.main.GetOrFallback(TooltipFactory.techTypeIngredientStrings.Get(techType), techType))); if (!icons.Contains(icon)) { continue; } icons.Remove(icon); var tooltipIcon = new TooltipIcon() { sprite = SpriteManager.Get(TechType.None), text = Main.Config.UnKnownTitle }; icons.Add(tooltipIcon); } }
public static void Postfix(bool locked, ref TooltipData data) { if (locked && GameModeUtils.RequiresBlueprints()) { data.prefix.Clear(); TooltipFactory.WriteTitle(data.prefix, Main.Config.UnKnownTitle); TooltipFactory.WriteDescription(data.prefix, Main.Config.UnKnownDescription); } }
public static void Postfix(bool locked, ref string tooltipText) { var stringBuilder = new StringBuilder(); if (!locked || !GameModeUtils.RequiresBlueprints()) { return; } TooltipFactory.WriteTitle(stringBuilder, Main.Config.UnKnownTitle); TooltipFactory.WriteDescription(stringBuilder, Main.Config.UnKnownDescription); tooltipText = stringBuilder.ToString(); }
public static void Postfix(TechType techType, ref bool __result) { if (Main.config.Hardcore && GameModeUtils.RequiresBlueprints() && __result) { if (!QModServices.Main.ModPresent("UITweaks")) { RecipeData data = Main.GetData(techType); int ingredientCount = data?.ingredientCount ?? 0; for (int i = 0; i < ingredientCount; i++) { Ingredient ingredient = data.Ingredients[i]; if (!blackList.Contains(techType) && !CrafterLogic.IsCraftRecipeUnlocked(ingredient.techType)) { __result = false; return; } } } else { #if SN1 if (CraftData.techData.TryGetValue(techType, out CraftData.TechData data)) { int ingredientCount = data?.ingredientCount ?? 0; for (int i = 0; i < ingredientCount; i++) { IIngredient ingredient = data.GetIngredient(i); if (!blackList.Contains(techType) && !CrafterLogic.IsCraftRecipeUnlocked(ingredient.techType)) { __result = false; return; } } } #elif BZ #endif } } }
public static void IsCraftRecipeUnlocked_Postfix(ref bool __result, TechType techType) { if (techType != TechType.None && __result && GameModeUtils.RequiresBlueprints()) { if (techType == SeamothDoll || techType == SeamothFragment1 || techType == SeamothFragment2 || techType == SeamothFragment3 || techType == SeamothFragment4 || techType == SeamothFragment5) { if (ConfigSwitcher.AddItemsWhenDiscovered && KnownTech.GetTechUnlockState(TechType.Seamoth) != TechUnlockState.Available) { __result = false; } } else if (techType == ExosuitDoll) { if (ConfigSwitcher.AddItemsWhenDiscovered && KnownTech.GetTechUnlockState(TechType.Exosuit) != TechUnlockState.Available) { __result = false; } } else if (techType == CyclopsDoll) { if (ConfigSwitcher.AddItemsWhenDiscovered && KnownTech.GetTechUnlockState(TechType.Cyclops) != TechUnlockState.Available) { __result = false; } } else if (techType == CuddleFishDoll) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("CuteFish")) { __result = false; } } else if (techType == GhostLeviathanDoll) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("GhostLeviathan") && !PDAEncyclopedia.ContainsEntry("GhostLeviathanJuvenile")) { __result = false; } } else if (techType == ReaperLeviathanDoll) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("ReaperLeviathan")) { __result = false; } } else if (techType == ReefBackDoll) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("Reefback")) { __result = false; } } else if (techType == SeaDragonDoll) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("SeaDragon")) { __result = false; } } else if (techType == SeaEmperorDoll) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("SeaEmperorLeviathan") && !PDAEncyclopedia.ContainsEntry("SeaEmperorBaby")) { __result = false; } } else if (techType == SeaTreaderDoll) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("SeaTreader")) { __result = false; } } else if (techType == ReaperSkeletonDoll || techType == ReaperSkullDoll) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("LavaZone_ReaperSkeleton")) { __result = false; } } else if (techType == SeaDragonSkeleton) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("LostRiverBase_SeaDragonSkeleton")) { __result = false; } } else if (techType == GenericSkeleton1 || techType == GenericSkeleton2 || techType == GenericSkeleton3) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("Precursor_LostRiverBase_Bones") && !PDAEncyclopedia.ContainsEntry("Precursor_LostRiverBase_GiantFishSkeleton") && !PDAEncyclopedia.ContainsEntry("Precursor_LostRiverBase_SeaDragonSkeleton") && !PDAEncyclopedia.ContainsEntry("LostRiver_BonesfieldHugeSkeleton") && !PDAEncyclopedia.ContainsEntry("Precursor_LostRiverBase_CaveSkeletonScan") && !PDAEncyclopedia.ContainsEntry("LavaZone_ReaperSkeleton") && !PDAEncyclopedia.ContainsEntry("Precursor_Cache_LostRiverBonesScan")) { __result = false; } } else if (techType == AlienArtefact1) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("PrecursorPrisonArtifact1")) { __result = false; } } else if (techType == AlienArtefact2) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("PrecursorPrisonArtifact2")) { __result = false; } } else if (techType == AlienArtefact3) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("PrecursorPrisonArtifact3")) { __result = false; } } else if (techType == AlienArtefact4) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("PrecursorPrisonArtifact4")) { __result = false; } } else if (techType == AlienArtefact5) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("PrecursorPrisonArtifact5")) { __result = false; } } else if (techType == AlienArtefact6) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("PrecursorPrisonArtifact6")) { __result = false; } } else if (techType == AlienArtefact7) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("PrecursorPrisonArtifact7")) { __result = false; } } else if (techType == AlienArtefact8) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("PrecursorPrisonArtifact8")) { __result = false; } } else if (techType == AlienArtefact9) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("PrecursorPrisonArtifact10")) { __result = false; } } else if (techType == AlienArtefact10) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("PrecursorPrisonArtifact11")) { __result = false; } } else if (techType == AlienArtefact11) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("PrecursorPrisonArtifact12")) { __result = false; } } else if (techType == BenchSmall || techType == BenchMedium) { if (ConfigSwitcher.AddItemsWhenDiscovered && KnownTech.GetTechUnlockState(TechType.Bench) != TechUnlockState.Available) { __result = false; } } else if (techType == SofaCorner || techType == Sofa1 || techType == Sofa2 || techType == Sofa3) { if (ConfigSwitcher.AddItemsWhenDiscovered && !(KnownTech.GetTechUnlockState(TechType.Bench) == TechUnlockState.Available && KnownTech.GetTechUnlockState(TechType.StarshipChair) == TechUnlockState.Available && KnownTech.GetTechUnlockState(TechType.StarshipChair2) == TechUnlockState.Available && KnownTech.GetTechUnlockState(TechType.StarshipChair3) == TechUnlockState.Available)) { __result = false; } } else if (techType == Stool) { if (ConfigSwitcher.AddItemsWhenDiscovered && !(KnownTech.GetTechUnlockState(TechType.StarshipChair) == TechUnlockState.Available || KnownTech.GetTechUnlockState(TechType.StarshipChair2) == TechUnlockState.Available || KnownTech.GetTechUnlockState(TechType.StarshipChair3) == TechUnlockState.Available)) { __result = false; } } else if (techType == LongPlanterA) { if (ConfigSwitcher.AddItemsWhenDiscovered && KnownTech.GetTechUnlockState(TechType.PlanterBox) != TechUnlockState.Available) { __result = false; } } else if (techType == LongPlanterB) { if (ConfigSwitcher.AddItemsWhenDiscovered && KnownTech.GetTechUnlockState(TechType.FarmingTray) != TechUnlockState.Available) { __result = false; } } else if (techType == EmptyDesk) { if (ConfigSwitcher.AddItemsWhenDiscovered && KnownTech.GetTechUnlockState(TechType.StarshipDesk) != TechUnlockState.Available) { __result = false; } } else if (techType == CustomizablePictureFrame) { if (ConfigSwitcher.AddItemsWhenDiscovered && KnownTech.GetTechUnlockState(TechType.PictureFrame) != TechUnlockState.Available) { __result = false; } } else if (techType == ReactorLamp) { if (ConfigSwitcher.AddItemsWhenDiscovered && !(KnownTech.GetTechUnlockState(TechType.Spotlight) == TechUnlockState.Available || KnownTech.GetTechUnlockState(TechType.LEDLight) == TechUnlockState.Available || KnownTech.GetTechUnlockState(TechType.Techlight) == TechUnlockState.Available)) { __result = false; } } else if (techType == AlienPillar) { if (ConfigSwitcher.AddItemsWhenDiscovered && !(PDAEncyclopedia.ContainsEntry("PrecursorTeleporter") || PDAEncyclopedia.ContainsEntry("PrecursorKeyTerminal") || PDAEncyclopedia.ContainsEntry("PrecursorEnergyCore") || PDAEncyclopedia.ContainsEntry("Precursor_Cache_LostRiverLabTable"))) { __result = false; } } else if (techType == WarperPart1) { if (ConfigSwitcher.AddItemsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("Precursor_LostRiverBase_WarperScan")) { __result = false; } } else if (techType == WarperPart2 || techType == WarperPart3 || techType == WarperPart4 || techType == WarperPart5 || techType == WarperPart6 || techType == WarperPart7 || techType == WarperPart8 || techType == WarperPart9 || techType == WarperPart10 || techType == WarperPart11 || techType == WarperPart12) { if (ConfigSwitcher.AddItemsWhenDiscovered && !(PDAEncyclopedia.ContainsEntry("Precursor_LostRiverBase_ProductionLine") || PDAEncyclopedia.ContainsEntry("Precursor_LostRiverBase_WarperParts"))) { __result = false; } } else if (techType == LabCart || techType == SpecimenAnalyzer || techType == LabRobotArm) { if (ConfigSwitcher.AddItemsWhenDiscovered && KnownTech.GetTechUnlockState(TechType.BaseWaterPark) != TechUnlockState.Available) { __result = false; } } else if (techType == FloatingStone1) { if (ConfigSwitcher.AddWaterSeedsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("FloatingStones")) { __result = false; } } else if (techType == BrineLily) { if (ConfigSwitcher.AddWaterSeedsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("BlueLostRiverLilly")) { __result = false; } } else if (techType == Amoeba) { if (ConfigSwitcher.AddWaterSeedsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("BlueAmoeba")) { __result = false; } } else if (techType == PyroCoral1 || techType == PyroCoral2 || techType == PyroCoral3) { if (ConfigSwitcher.AddWaterSeedsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("RedTipRockThings")) { __result = false; } } else if (techType == CrabClawKelp1 || techType == CrabClawKelp2 || techType == CrabClawKelp3) { if (ConfigSwitcher.AddWaterSeedsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("BlueTipLostRiverPlant")) { __result = false; } } else if (techType == BrownTubes1 || techType == BrownTubes2 || techType == BrownTubes3) { if (ConfigSwitcher.AddWaterSeedsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("EarthenCoralTubes")) { __result = false; } } else if (techType == CoveTree || techType == GiantCoveTree) { if (ConfigSwitcher.AddWaterSeedsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("TreeCoveTree")) { __result = false; } } else if (techType == MushroomTree1 || techType == MushroomTree2) { if (ConfigSwitcher.AddWaterSeedsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("TreeLeech") && !PDAEncyclopedia.ContainsEntry("TreeMushroom") && !PDAEncyclopedia.ContainsEntry("TreeMushroomPiece")) { __result = false; } } else if (techType == MarbleMelonTiny) { if (ConfigSwitcher.AddAirSeedsWhenDiscovered && !PDAEncyclopedia.ContainsEntry("MelonPlant") && !PDAEncyclopedia.ContainsEntry("MelonSeed") && !PDAEncyclopedia.ContainsEntry("SmallMelon") && !PDAEncyclopedia.ContainsEntry("Melon")) { __result = false; } } else if (!ConfigSwitcher.EnableEggsAtStart) { if (techType == GhostLeviathanEggs) { if (ConfigSwitcher.EnableEggsWhenCreatureScanned) { if (!PDAEncyclopedia.ContainsEntry("TreeCoveTree") && !PDAEncyclopedia.ContainsEntry("GhostLeviathan") && !PDAEncyclopedia.ContainsEntry("GhostLeviathanJuvenile")) { __result = false; } } else if (!PDAEncyclopedia.ContainsEntry("TreeCoveTree")) { __result = false; } } else if (techType == SeaDragonEgg) { if (ConfigSwitcher.EnableEggsWhenCreatureScanned) { if (!PDAEncyclopedia.ContainsEntry("Precursor_LostRiverBase_LeviathanEggShellScan") && !PDAEncyclopedia.ContainsEntry("SeaDragon")) { __result = false; } } else if (!PDAEncyclopedia.ContainsEntry("Precursor_LostRiverBase_LeviathanEggShellScan")) { __result = false; } } else if (techType == SeaEmperorEgg) { if (ConfigSwitcher.EnableEggsWhenCreatureScanned) { if (!PDAEncyclopedia.ContainsEntry("PrecursorPrisonEggChamberEmperorEgg") && !PDAEncyclopedia.ContainsEntry("PrecursorPrisonAquariumIncubatorEggs") && !PDAEncyclopedia.ContainsEntry("SeaEmperor") && !PDAEncyclopedia.ContainsEntry("SeaEmperorLeviathan") && !PDAEncyclopedia.ContainsEntry("SeaEmperorBaby")) { __result = false; } } else if (!PDAEncyclopedia.ContainsEntry("PrecursorPrisonEggChamberEmperorEgg") && !PDAEncyclopedia.ContainsEntry("PrecursorPrisonAquariumIncubatorEggs")) { __result = false; } } else if (ConfigSwitcher.EnableEggsWhenCreatureScanned) { switch (techType) { case TechType.BonesharkEgg: if (!PDAEncyclopedia.ContainsEntry("Boneshark")) { __result = false; } break; case TechType.CrabsnakeEgg: if (!PDAEncyclopedia.ContainsEntry("Crabsnake")) { __result = false; } break; case TechType.CrabsquidEgg: if (!PDAEncyclopedia.ContainsEntry("Crabsquid")) { __result = false; } break; case TechType.CrashEgg: if (!PDAEncyclopedia.ContainsEntry("Crash") && !PDAEncyclopedia.ContainsEntry("CrashLair")) { __result = false; } break; case TechType.CutefishEgg: if (!PDAEncyclopedia.ContainsEntry("CuteFish")) { __result = false; } break; case TechType.GasopodEgg: if (!PDAEncyclopedia.ContainsEntry("Gasopod")) { __result = false; } break; case TechType.JellyrayEgg: if (!PDAEncyclopedia.ContainsEntry("Jellyray")) { __result = false; } break; case TechType.JumperEgg: if (!PDAEncyclopedia.ContainsEntry("Shuttlebug")) { __result = false; } break; case TechType.LavaLizardEgg: if (!PDAEncyclopedia.ContainsEntry("LavaLizard")) { __result = false; } break; case TechType.MesmerEgg: if (!PDAEncyclopedia.ContainsEntry("Mesmer")) { __result = false; } break; case TechType.RabbitrayEgg: if (!PDAEncyclopedia.ContainsEntry("RabbitRay")) { __result = false; } break; case TechType.ReefbackEgg: if (!PDAEncyclopedia.ContainsEntry("Reefback")) { __result = false; } break; case TechType.SandsharkEgg: if (!PDAEncyclopedia.ContainsEntry("SandShark")) { __result = false; } break; case TechType.ShockerEgg: if (!PDAEncyclopedia.ContainsEntry("Ampeel")) { __result = false; } break; case TechType.SpadefishEgg: if (!PDAEncyclopedia.ContainsEntry("Spadefish")) { __result = false; } break; case TechType.StalkerEgg: if (!PDAEncyclopedia.ContainsEntry("Stalker")) { __result = false; } break; default: break; } } } } }
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 }
public static void Postfix() { PDAScanner.ScanTarget scanTarget = PDAScanner.scanTarget; PDAScanner.EntryData entryData = PDAScanner.GetEntryData(scanTarget.techType); TechType key = entryData?.key ?? TechType.None; TechType blueprint = entryData?.blueprint ?? TechType.None; if (scanTarget.techType != TechType.None && CrafterLogic.IsCraftRecipeUnlocked(scanTarget.techType) || (entryData != null && ((blueprint != TechType.None && CrafterLogic.IsCraftRecipeUnlocked(entryData.blueprint)) || (key != TechType.None && CrafterLogic.IsCraftRecipeUnlocked(entryData.key)))) || !scanTarget.isValid || !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 }