source: FiniteItemRepairs/ModMain.cs

Last change on this file was 509, checked in by alloc, 27 hours ago

Initial commit for FiniteItemRepairs mod

File size: 748 bytes
RevLine 
[509]1using System.Reflection;
2using HarmonyLib;
3using JetBrains.Annotations;
4
5namespace FiniteItemRepairs
6{
7 [UsedImplicitly]
8 public class ModMain : IModApi
9 {
10 public static Mod Mod;
11
12 public void InitMod(Mod modInstance)
13 {
14 Mod = modInstance;
15 Settings.Init();
16
17 ModEvents.GameShutdown.RegisterHandler(OnGameShutdown);
18
19 Harmony harmony = new(GetType().ToString());
20 harmony.PatchAll(Assembly.GetExecutingAssembly());
21 }
22
23 private static void OnGameShutdown(ref ModEvents.SGameShutdownData data)
24 {
25 Settings.Save();
26 Settings.DestroyFileWatcher();
27 }
28 }
29}
Note: See TracBrowser for help on using the repository browser.