-
Notifications
You must be signed in to change notification settings - Fork 2
/
Main.cs
79 lines (65 loc) · 2.22 KB
/
Main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System.Collections.Generic;
using HarmonyLib;
using JetBrains.Annotations;
using ModLoader;
using SFS.IO;
namespace UITools
{
/// <summary>
/// Main class of the mod
/// </summary>
// ReSharper disable once ClassNeverInstantiated.Global
[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)]
public class Main : Mod, IUpdatable
{
internal static Main main;
Harmony patcher;
/// <summary>Default constructor</summary>
public Main()
{
main = this;
}
// Implementation
/// <summary>NameID</summary>
public override string ModNameID => "UITools";
/// <summary>DisplayName</summary>
public override string DisplayName => "UI Tools";
/// <summary>Author</summary>
public override string Author => "StarMods";
/// <summary>MinimumGameVersionNecessary</summary>
public override string MinimumGameVersionNecessary => "1.5.8";
/// <summary>ModVersion</summary>
public override string ModVersion => "1.1.5";
/// <summary>Description</summary>
public override string Description =>
"Mod that provides advanced UI functionality and used by other mods as dependency";
/// <summary>Icon</summary>
public override string IconLink => "https://i.imgur.com/r7rCmJT.jpg";
/// <inheritdoc />
public Dictionary<string, FilePath> UpdatableFiles => new()
{
{
"https://github.com/cucumber-sp/UITools/releases/latest/download/UITools.dll",
new FolderPath(ModFolder).ExtendToFile("UITools.dll")
}
};
/// <summary>Early Load</summary>
public override void Early_Load()
{
PatchAll();
ConfigurationMenu.Initialize();
PositionSaver.Initialize();
}
/// <summary>
/// Load
/// </summary>
public override async void Load()
{
await ModsUpdater.UpdateAll();
}
void PatchAll()
{
(patcher ??= new Harmony("UITools")).PatchAll();
}
}
}