-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSubModule.cs
More file actions
52 lines (47 loc) · 1.17 KB
/
SubModule.cs
File metadata and controls
52 lines (47 loc) · 1.17 KB
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
using System;
using FormationSorter.Utilities;
using HarmonyLib;
using TaleWorlds.MountAndBlade;
namespace FormationSorter;
public class SubModule : MBSubModuleBase
{
internal const string Id = "FormationSorter";
internal const string Name = "Formation Sorter";
internal const string Version = "3.3.1";
private static bool patched;
protected override void OnBeforeInitialModuleScreenSetAsRoot()
{
base.OnBeforeInitialModuleScreenSetAsRoot();
try
{
if (patched)
return;
patched = true;
new Harmony("pointfeev." + Id.ToLower()).PatchAll();
}
catch (Exception e)
{
OutputUtils.DoOutputForException(e);
}
}
protected override void OnApplicationTick(float dt)
{
base.OnApplicationTick(dt);
try
{
HotKeys.OnApplicationTick();
}
catch (Exception e)
{
OutputUtils.DoOutputForException(e);
}
try
{
Order.OnApplicationTick();
}
catch (Exception e)
{
OutputUtils.DoOutputForException(e);
}
}
}