/// <summary> /// Called after dll has been injected /// </summary> public Core() { DebugHelper.ShowConsoleWindow(); CurrentProcess = Process.GetCurrentProcess(); Globals.Players = new Player[33]; GameFuncs.Init(); Blitzmax.Init(); Patches.Init(); ReadSignatures(); InitHooks(); }
public static void Init(string modDir, string settings) { Log("Starting up"); harmony = HarmonyInstance.Create("ca.gnivler.BattleTech.Z_JK_AppearanceDates"); harmony.PatchAll(Assembly.GetExecutingAssembly()); // read settings try { ModSettings = JsonConvert.DeserializeObject <Settings>(settings); ModSettings.modDirectory = modDir; } catch (Exception) { ModSettings = new Settings(); } Patches.Init(); //File.WriteAllText(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName + "settings.json", JSON.ToNiceJSON(ModSettings, new JSONParameters())); }
static void Load(UnityModManager.ModEntry mod_entry) { mod_entry.OnToggle = OnToggle; Patches.Init(); Log("Startup"); }