forked from Cities2Modding/FirstPersonCamera
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMod.cs
More file actions
49 lines (38 loc) · 1.58 KB
/
Copy pathMod.cs
File metadata and controls
49 lines (38 loc) · 1.58 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
using Game.Modding;
using Game;
using HarmonyLib;
using Colossal.Logging;
using Colossal.IO.AssetDatabase;
using Game.SceneFlow;
using Game.Settings;
using static Cinemachine.CinemachineTriggerAction;
using Game.Input;
using FirstPersonCameraContinued.Systems;
using Game.Rendering;
using Unity.Entities;
namespace FirstPersonCameraContinued
{
public class Mod : IMod
{
private Harmony? _harmony;
public static Setting? FirstPersonModSettings;
public static ILog log = LogManager.GetLogger($"{nameof(FirstPersonCameraContinued)}.{nameof(Mod)}").SetShowsErrorsInUI(true);
public const string kButtonActionName = "EnterFreeModeBinding";
public void OnLoad(UpdateSystem updateSystem)
{
_harmony = new($"{nameof(FirstPersonCameraContinued)}.{nameof(Mod)}");
_harmony.PatchAll(typeof(Mod).Assembly);
FirstPersonModSettings = new Setting(this);
FirstPersonModSettings.RegisterInOptionsUI();
Localization.LoadTranslations(FirstPersonModSettings, log);
FirstPersonModSettings.RegisterKeyBindings();
AssetDatabase.global.LoadSettings(nameof(FirstPersonCameraContinued), FirstPersonModSettings, new Setting(this));
updateSystem.UpdateBefore<FirstPersonCameraActivatedUISystem>(SystemUpdatePhase.UIUpdate);
updateSystem.UpdateAt<FirstPersonCameraPIPSystem>(SystemUpdatePhase.Rendering);
}
public void OnDispose()
{
_harmony?.UnpatchAll($"{nameof(FirstPersonCameraContinued)}.{nameof(Mod)}");
}
}
}