-
Notifications
You must be signed in to change notification settings - Fork 7
/
ModLibSubModule.cs
38 lines (34 loc) · 1.13 KB
/
ModLibSubModule.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
using ModLib.Debugging;
using ModLib.GUI.GauntletUI;
using System;
using System.Windows.Forms;
using TaleWorlds.Engine.Screens;
using TaleWorlds.Localization;
using TaleWorlds.MountAndBlade;
namespace ModLib
{
public class ModLibSubModule : MBSubModuleBase
{
public static string ModuleFolderName { get; } = "ModLib";
protected override void OnSubModuleLoad()
{
try
{
FileDatabase.Initialise(ModuleFolderName);
Module.CurrentModule.AddInitialStateOption(new InitialStateOption("ModOptionsMenu", new TextObject("Mod Options"), 9990, () =>
{
ScreenManager.PushScreen(new ModOptionsGauntletScreen());
}, false));
}
catch (Exception ex)
{
ModDebug.ShowError($"An error occurred whilst initialising ModLib", "Error during initialisation", ex);
}
}
protected override void OnBeforeInitialModuleScreenSetAsRoot()
{
SettingsDatabase.LoadAllSettings();
SettingsDatabase.BuildModSettingsVMs();
}
}
}