forked from doshyw/CelesteArchipelago
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCelesteArchipelagoModule.cs
43 lines (33 loc) · 1.72 KB
/
CelesteArchipelagoModule.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
using System;
namespace Celeste.Mod.CelesteArchipelago {
public class CelesteArchipelagoModule : EverestModule {
public static CelesteArchipelagoModule Instance { get; private set; }
public override Type SettingsType => typeof(CelesteArchipelagoModuleSettings);
public static CelesteArchipelagoModuleSettings Settings => (CelesteArchipelagoModuleSettings) Instance._Settings;
// If you need to store save data:
public override Type SaveDataType => typeof(CelesteArchipelagoSaveData);
public static CelesteArchipelagoSaveData SaveData => (CelesteArchipelagoSaveData)Instance._SaveData;
public override Type SessionType => typeof(CelesteArchipelagoModuleSession);
public static CelesteArchipelagoModuleSession Session => (CelesteArchipelagoModuleSession) Instance._Session;
public CelesteArchipelagoModule() {
Instance = this;
#if DEBUG
// debug builds use verbose logging
Logger.SetLogLevel(nameof(CelesteArchipelagoModule), LogLevel.Verbose);
#else
// release builds use info logging to reduce spam in log files
Logger.SetLogLevel(nameof(CelesteArchipelagoModule), LogLevel.Info);
#endif
}
public override void Load() {
new ArchipelagoController(Celeste.Instance);
ArchipelagoController.Instance.LoadPatches();
Everest.Events.MainMenu.OnCreateButtons += ArchipelagoUI.ReplaceClimbButton;
}
public override void Unload() {
ArchipelagoController.Instance.UnloadPatches();
ArchipelagoController.Instance.Dispose();
Everest.Events.MainMenu.OnCreateButtons -= ArchipelagoUI.ReplaceClimbButton;
}
}
}