-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathModClassWiring.cs
57 lines (48 loc) · 1.71 KB
/
ModClassWiring.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
using MultiplayerEvents.Settings;
namespace MultiplayerEvents
{
public partial class MultiplayerEvents : IGlobalSettings<GlobalModSettings>, ILocalSettings<LocalModSettings>, ICustomMenuMod
{
private string GetVersionSafely()
{
return Satchel.AssemblyUtils.GetAssemblyVersionHash();
}
public override string GetVersion()
{
var version = "Satchel not found";
try
{
version = GetVersionSafely();
}
catch (Exception e)
{
Modding.Logger.Log(e.ToString());
}
return version;
}
public static GlobalModSettings GlobalSettings { get; set; } = new GlobalModSettings();
public static LocalModSettings LocalSettings { get; set; } = new LocalModSettings();
public void OnLoadGlobal(GlobalModSettings s)
{
GlobalSettings = s;
}
public GlobalModSettings OnSaveGlobal() => MultiplayerEvents.GlobalSettings;
public void OnLoadLocal(LocalModSettings s)
{
MultiplayerEvents.LocalSettings = s;
if (MultiplayerEvents.LocalSettings.CharmStates != null && skillManager != null)
{
skillManager.RestoreCharmStates(MultiplayerEvents.LocalSettings.CharmStates);
}
}
public LocalModSettings OnSaveLocal()
{
return MultiplayerEvents.LocalSettings;
}
public bool ToggleButtonInsideMenu { get; } = false;
public MenuScreen GetMenuScreen(MenuScreen modListMenu, ModToggleDelegates? toggle)
{
return BetterMenu.GetMenu(modListMenu);
}
}
}