Last change
on this file since 509 was 509, checked in by alloc, 23 hours ago |
Initial commit for FiniteItemRepairs mod
|
File size:
748 bytes
|
Rev | Line | |
---|
[509] | 1 | using System.Reflection;
|
---|
| 2 | using HarmonyLib;
|
---|
| 3 | using JetBrains.Annotations;
|
---|
| 4 |
|
---|
| 5 | namespace 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.