private static void ReplaceNodeTech(uGUI_CraftNode node) { if (node.action != TreeAction.Craft) { return; } TechType recyclingTech; if (RecyclingData.TryGet(node.techType0, out recyclingTech)) { replacedNodeTechs[node] = node.techType0; node.techType0 = recyclingTech; } }
public static void Postfix() { foreach (TechType techType in Enum.GetValues(typeof(TechType))) { #if SUBNAUTICA if (SMLHelper.V2.Handlers.CraftDataHandler.GetTechData(techType) != null) #elif BELOWZERO if (SMLHelper.V2.Handlers.CraftDataHandler.GetRecipeData(techType) != null) #endif { RecyclingData.TryGet(techType, out TechType recyclingTech, true); } } #if BELOWZERO TechData.Cache(); #endif CraftData.RebuildDatabase(); Language.main.LoadLanguageFile(Language.main.GetCurrentLanguage()); }
private static void ReplaceNodeTech(uGUI_CraftNode node) { if (node.action != TreeAction.Craft) { return; } if (!node.techType0.ToString().StartsWith("Defabricated") && RecyclingData.TryGet(node.techType0, out TechType recyclingTech)) { node.techType0 = recyclingTech; } else if (node.techType0.ToString().StartsWith("Defabricated")) { TechTypeExtensions.FromString(node.techType0.ToString().Replace("Defabricated", ""), out TechType original, true); node.techType0 = original; } else { ErrorMessage.AddMessage($"Failed to change {node.techType0}"); } }