static MapDesigner() { Harmony harmony = new Harmony("zylle.MapDesigner"); Log.Message("[Map Designer] Initializing.... "); harmony.PatchAll(); if (ModsConfig.RoyaltyActive) { try { MethodInfo targetmethod = AccessTools.Method(typeof(RimWorld.GenStep_AnimaTrees), "DesiredTreeCountForMap"); //HarmonyMethod postfix = new HarmonyMethod(typeof(MapDesigner).GetMethod("AnimaTreePatch")); HarmonyMethod postfix = new HarmonyMethod(typeof(AnimaTreePatch).GetMethod("Postfix", BindingFlags.NonPublic | BindingFlags.Static)); harmony.Patch(targetmethod, null, postfix); } catch { Log.Message("[Map Designer] ERROR: Failed to patch anima trees"); } } if (GenTypes.GetTypeInAnyAssembly("MapReroll.MapPreviewGenerator") != null) { Log.Message("Found Map Reroll"); HelperMethods.ApplyMapRerollPatches(); } HelperMethods.InitBiomeDefaults(); HelperMethods.ApplyBiomeSettings(); }
private static void ApplyPreset() { switch (selPreset) { case Preset.Vanilla: ResetAllSettings(); break; case Preset.FertileValley: PresetFertileValley(); break; case Preset.Barrens: PresetBarrens(); break; case Preset.Unnatural: PresetUnnatural(); break; case Preset.FishingVillage: PresetFishingVillage(); break; case Preset.Canyon: PresetCanyon(); break; case Preset.ZyllesChoice: PresetZyllesChoice(); break; case Preset.Random: PresetRandom(); break; default: break; } HelperMethods.ApplyBiomeSettings(); }
static void Prefix() { HelperMethods.ApplyBiomeSettings(); }