public static void patch() { HarmonyHelper.patchAll(true); LanguageHelper.init(); DayNightSpeedControl.init(); }
public static void patch() { LanguageHelper.init(); HarmonyHelper.patchAll(); CraftHelper.patchAll(); }
public static void init() { if (!inited && (inited = true)) { patches.forEach(p => HarmonyHelper.patch(p.Item2, transpiler: p.Item1)); } }
public static void Patch() { HarmonyHelper.Patch(); new HorizontalWallLocker().Patch(); Logger.Log("Patched"); }
public static void Enable() { try { Log.Debug("Testing StackTrace:\n" + new StackTrace(true).ToString(), copyToGameLog: false); KianCommons.UI.TextureUtil.EmbededResources = false; HelpersExtensions.VERBOSE = false; Loaded = false; Log.Buffered = true; HarmonyHelper.EnsureHarmonyInstalled(); //LoadingManager.instance.m_simulationDataReady += SimulationDataReady; // load/update data LoadingManager.instance.m_levelPreLoaded += Preload; if (LoadingManager.instance.m_loadingComplete) { HotReload(); } #if FAST_TEST_HARMONY HarmonyHelper.DoOnHarmonyReady(() => { HarmonyUtil.InstallHarmony(HARMONY_ID); Process.GetCurrentProcess().Kill(); }); #endif Test(); } catch (Exception ex) { Log.Exception(ex); } }
public void OnEnabled() { HarmonyHelper.DoOnHarmonyReady(() => { Debug.Log("[Trolleybus Trailer AI] Try Patch..."); Patcher.PatchAll(); }); }
public static void patch() { Mod.init(); HarmonyHelper.patchAll(); CraftHelper.patchAll(); }
public static void patchAll() { if (!patched && (patched = true)) { toPatch.forEach(p => HarmonyHelper.patch(p, transpiler: patch)); } }
public static void patch() { HarmonyHelper.patchAll(true); MiscStuff.init(); PersistentConsoleCommands.register <ConsoleCommands>(); }
public static void LoadMods() { SecondaryLog($"In {nameof(ModLoader)}.{nameof(LoadMods)}!"); SecondaryLog("Getting config..."); var config = GetConfig(); if (config == null) { SecondaryLog("Config is null"); return; } SecondaryLog("Got config!"); SecondaryLog("Loading mods..."); try { var logger = new ModLogger(config); var console = new ModConsole(config); var harmonyHelper = new HarmonyHelper(logger, console); var events = new ModEvents(harmonyHelper); var assets = new ModAssets(console); var helper = new ModHelper(config, logger, console, events, harmonyHelper, assets); var modFinder = new ModFinder(config); var owo = new Owo(helper, modFinder); owo.LoadMods(); SecondaryLog("Loaded mods"); } catch (Exception ex) { SecondaryLog("Error while loading mods: " + ex); } }
/// <summary> /// Called by the game when the mod is enabled. /// </summary> public void OnEnabled() { // Apply Harmony patches via Cities Harmony. // Called here instead of OnCreated to allow the auto-downloader to do its work prior to launch. HarmonyHelper.DoOnHarmonyReady(() => Patcher.PatchAll()); // Load settings file. SettingsUtils.LoadSettings(); // Populate (legacy) Datastore from configuration file. // Make sure this happens before loading the new configuration file, which will overwrite any settings here. // This establishes the correct priority (new over legacy). XMLUtilsWG.ReadFromXML(); // Attaching options panel event hook - check to see if UIView is ready. if (UIView.GetAView() != null) { // It's ready - attach the hook now. OptionsPanel.OptionsEventHook(); } else { // Otherwise, queue the hook for when the intro's finished loading. LoadingManager.instance.m_introLoaded += OptionsPanel.OptionsEventHook; } }
public static bool Init() { try { MethodInfo methodBase; MethodInfo methodPatcher; { Logger.Log("Started patching Farmer"); methodBase = typeof(Player).GetMethod("getItemCount", BindingFlags.Instance | BindingFlags.Public); methodPatcher = typeof(FarmerPatcher).GetMethod("Prefix", BindingFlags.Static | BindingFlags.NonPublic); Logger.Log("Trying to patch..."); if (!HarmonyHelper.Patch(methodBase, methodPatcher)) { return(false); } } { Logger.Log("Started patching consumeIngredients"); methodBase = typeof(CraftingRecipe).GetMethod("consumeIngredients", BindingFlags.Instance | BindingFlags.Public); methodPatcher = typeof(ConsumeIngredientsPatcher).GetMethod("Prefix", BindingFlags.Static | BindingFlags.NonPublic); Logger.Log("Trying to patch..."); if (!HarmonyHelper.Patch(methodBase, methodPatcher)) { return(false); } } } catch (Exception e) { Logger.Error(e.ToString()); return(false); } return(true); }
public static void Patch() { try { HarmonyHelper.Patch(); Logger.Log("Patched successfully!"); PFC_Config.Enable = PlayerPrefsExtra.GetBool("pfcEnable", true); Logger.Log("Obtained values from config"); OptionsPanelHandler.RegisterModOptions(new Options("Pickup Full Carry-alls")); Logger.Log("Registered mod options"); ItemActionHelper.RegisterAction(MouseButton.Middle, TechType.LuggageBag, InventoryOpener.OnMiddleClick, "open storage", InventoryOpener.Condition); ItemActionHelper.RegisterAction(MouseButton.Middle, TechType.SmallStorage, InventoryOpener.OnMiddleClick, "open storage", InventoryOpener.Condition); /* * ItemActionHandler.RegisterMiddleClickAction(TechType.LuggageBag, InventoryOpener.OnMiddleClick, "open storage"); * ItemActionHandler.RegisterMiddleClickAction(TechType.SmallStorage, InventoryOpener.OnMiddleClick, "open storage"); * * Logger.Log("Registered middle click actions"); */ } catch (Exception e) { Logger.Exception(e, LoggedWhen.Initializing); } }
public static void Patch() { HarmonyHelper.Patch(); new ESS().Patch(); Common.Logger.Log("Patched"); }
public static void LoadMods() { var owmlGo = new GameObject(); owmlGo.AddComponent <OwmlBehaviour>(); var owmlConfig = JsonHelper.LoadJsonObject <OwmlConfig>(ConfigPath); var owmlDefaultConfig = JsonHelper.LoadJsonObject <OwmlConfig>(DefaultConfigPath); var owmlManifest = JsonHelper.LoadJsonObject <ModManifest>(ManifestPath); if (owmlConfig == null || owmlManifest == null) { // Everything is wrong and can't write to console... return; } var logger = new ModLogger(owmlConfig, owmlManifest); logger.Log("Got config!"); var console = OutputFactory.CreateOutput(owmlConfig, logger, owmlManifest); console.WriteLine("Mod loader has been initialized."); var modSorter = new ModSorter(console); var modFinder = new ModFinder(owmlConfig, console); var harmonyHelper = new HarmonyHelper(logger, console); var events = new ModEvents(logger, console, harmonyHelper); var inputHandler = new ModInputHandler(logger, console, harmonyHelper, owmlConfig, events); var menus = new ModMenus(console, events, inputHandler, owmlManifest, owmlConfig, owmlDefaultConfig); var owo = new Owo(modFinder, logger, console, owmlConfig, menus, harmonyHelper, inputHandler, modSorter); owo.LoadMods(); }
public static void patch() { HarmonyHelper.patchAll(true); LanguageHelper.init(); CraftHelper.patchAll(); PersistentConsoleCommands.register <ConsoleCommands>(); }
/// <summary> /// Initializes the needed classes for the mod. /// </summary> private void InitializeClasses() { PackHelper = new ContentPackHelper(this); Dresser = new DresserHandler(this, Config); PlayerLoader = new CharacterLoader(this, PackHelper, Dresser); MenuPatcher = new SaveLoadMenuPatcher(this, PlayerLoader); HarmonyHelper = new HarmonyHelper(this); }
public void OnEnabled() { IsEnabled = true; FileStream fs = File.Create("CSURToolBox.txt"); fs.Close(); HarmonyHelper.EnsureHarmonyInstalled(); }
public void OnEnabled() { IsEnabled = true; FileStream fs = File.Create("MoreEffectiveTransfer.txt"); fs.Close(); HarmonyHelper.EnsureHarmonyInstalled(); }
public void OnEnabled() { IsEnabled = true; FileStream fs = File.Create("RealConstruction.txt"); fs.Close(); HarmonyHelper.EnsureHarmonyInstalled(); }
public static void patch() { HarmonyHelper.patchAll(true); CraftHelper.patchAll(); LanguageHelper.init(); // after CraftHelper DebrisPatcher.init(Mod.loadConfig <PrefabsConfig>(prefabsConfigName, Config.LoadOptions.ProcessAttributes)); }
public void OnEnabled() { HarmonyHelper.DoOnHarmonyReady(() => Patcher.PatchAll()); Enabled = true; if (Loading != null && Loading.loadingComplete) { SubstituteTextureManager.RegenerateCache(); } }
/// <summary> /// Called by the game when the mod is enabled. /// </summary> public void OnEnabled() { // Apply Harmony patches via Cities Harmony. // Called here instead of OnCreated to allow the auto-downloader to do its work prior to launch. HarmonyHelper.DoOnHarmonyReady(() => Patcher.PatchAll()); // Load the settings file. ZoningModSettingsFile.LoadSettings(); }
public void OnEnabled() { System.IO.File.WriteAllText("mod.debug.log", ""); // restart log. HarmonyHelper.DoOnHarmonyReady(() => HarmonyUtil.InstallHarmony(HarmonyId)); if (HelpersExtensions.InGame) { LifeCycle.Load(); } }
public void OnEnabled() { KianCommons.UI.TextureUtil.EmbededResources = false; HarmonyHelper.EnsureHarmonyInstalled(); if (HelpersExtensions.InGame) { LifeCycle.Load(); } }
public void OnEnabled() { HarmonyHelper.DoOnHarmonyReady(() => Patcher.PatchAll()); Enabled = true; if (Loading != null && Loading.loadingComplete) { Patches.RefreshNets(); } }
/// <summary> /// Called by the game when the mod is enabled. /// </summary> public void OnEnabled() { // Apply Harmony patches via Cities Harmony. // Called here instead of OnCreated to allow the auto-downloader to do its work prior to launch. HarmonyHelper.DoOnHarmonyReady(() => Patcher.PatchAll()); // Setup translation framework. Translations.Setup(); }
public void OnEnabled() { HarmonyHelper.EnsureHarmonyInstalled(); if (Extensions.InGame) { LifeCycle.Load(); } IsEnabled = true; }
public static void patch() { HarmonyHelper.patchAll(true); if (config.addConsoleCommands) { PersistentConsoleCommands.register <ConsoleCommands>(); } }
public static void patch() { HarmonyHelper.patchAll(); if (config.armsEnergyUsage.enabled) { ArmsEnergyUsage.refresh(); } }