-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCore.cs
41 lines (37 loc) · 1.19 KB
/
Core.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
using ModMaker;
using System;
using static TutorialCanvas.Main;
using static TutorialCanvas.Utilities.SettingsWrapper;
namespace TutorialCanvas
{
internal class Core : IModEventHandler
{
public UI.UIController UI { get; internal set; }
public int Priority => 200;
public void ResetSettings()
{
Mod.ResetSettings();
Mod.Settings.lastModVersion = Mod.Version.ToString();
LocalizationFileName = Local.FileName;
}
public void HandleModEnable()
{
if (!string.IsNullOrEmpty(LocalizationFileName))
{
Local.Import(LocalizationFileName, e => Mod.Error(e));
LocalizationFileName = Local.FileName;
}
if (!Version.TryParse(Mod.Settings.lastModVersion, out Version version) || version < new Version(0, 0, 0))
ResetSettings();
else
{
Mod.Settings.lastModVersion = Mod.Version.ToString();
}
Utilities.BundleManger.AddBundle("tutorialcanvas"); //Load our AssetBundle.
}
public void HandleModDisable()
{
UI = null;
}
}
}