-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMod.cs
More file actions
47 lines (38 loc) · 1.41 KB
/
Copy pathMod.cs
File metadata and controls
47 lines (38 loc) · 1.41 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
using Colossal.IO.AssetDatabase;
using Colossal.Logging;
using Colossal.UI;
using Game;
using Game.Modding;
using Game.Prefabs;
using Game.SceneFlow;
using Game.Settings;
using Game.UI;
using System.Configuration.Assemblies;
using System.IO;
using System.Reflection;
namespace Compass
{
public class Mod : IMod
{
public static ILog log = LogManager.GetLogger($"{nameof(Compass)}.{nameof(Mod)}").SetShowsErrorsInUI(false);
public static Setting CompassModSettings;
public void OnLoad(UpdateSystem updateSystem)
{
log.Info(nameof(OnLoad));
if (GameManager.instance.modManager.TryGetExecutableAsset(this, out var asset))
log.Info("Mod Directory:" + Path.GetDirectoryName(asset.path));
CompassModSettings = new Setting(this);
CompassModSettings.RegisterInOptionsUI();
CompassModSettings.RegisterKeyBindings();
updateSystem.UpdateBefore<CompassUISystem>(SystemUpdatePhase.UIUpdate);
Localization.LoadTranslations(CompassModSettings, log);
AssetDatabase.global.LoadSettings(nameof(Compass), CompassModSettings, new Setting(this));
//add custom icons
UIManager.defaultUISystem.AddHostLocation("compassmod", Path.GetDirectoryName(asset.path) + "/Icons/");
}
public void OnDispose()
{
log.Info(nameof(OnDispose));
}
}
}