-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPlugin.cs
More file actions
63 lines (53 loc) · 2.49 KB
/
Plugin.cs
File metadata and controls
63 lines (53 loc) · 2.49 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
53
54
55
56
57
58
59
60
61
62
63
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using Chameleon.Overrides;
using HarmonyLib;
using UnityEngine.SceneManagement;
namespace Chameleon
{
[BepInPlugin(PLUGIN_GUID, PLUGIN_NAME, PLUGIN_VERSION)]
[BepInDependency(GUID_ARTIFICE_BLIZZARD, BepInDependency.DependencyFlags.SoftDependency)]
[BepInDependency(GUID_LOBBY_COMPATIBILITY, BepInDependency.DependencyFlags.SoftDependency)]
[BepInDependency(GUID_BUTTERY_FIXES, BepInDependency.DependencyFlags.SoftDependency)]
[BepInDependency(GUID_NO_LOST_SIGNAL, BepInDependency.DependencyFlags.SoftDependency)]
public class Plugin : BaseUnityPlugin
{
internal const string PLUGIN_GUID = "butterystancakes.lethalcompany.chameleon", PLUGIN_NAME = "Chameleon", PLUGIN_VERSION = "2.3.3";
internal static new ManualLogSource Logger;
const string GUID_ARTIFICE_BLIZZARD = "butterystancakes.lethalcompany.artificeblizzard";
const string GUID_LOBBY_COMPATIBILITY = "BMX.LobbyCompatibility";
const string GUID_BUTTERY_FIXES = "butterystancakes.lethalcompany.butteryfixes";
const string GUID_NO_LOST_SIGNAL = "Tomatobird.NoLostSignal";
void Awake()
{
Logger = base.Logger;
if (Chainloader.PluginInfos.ContainsKey(GUID_LOBBY_COMPATIBILITY))
{
Logger.LogInfo("CROSS-COMPATIBILITY - Lobby Compatibility detected");
LobbyCompatibility.Init();
}
if (Chainloader.PluginInfos.ContainsKey(GUID_ARTIFICE_BLIZZARD))
{
Common.INSTALLED_ARTIFICE_BLIZZARD = true;
Logger.LogInfo("CROSS-COMPATIBILITY - Artifice Blizzard detected");
}
if (Chainloader.PluginInfos.ContainsKey(GUID_BUTTERY_FIXES))
{
Common.CAN_REPLACE_CAVE_TAGS = true;
Logger.LogInfo("CROSS-COMPATIBILITY - Buttery Fixes detected");
}
else if (Chainloader.PluginInfos.ContainsKey(GUID_NO_LOST_SIGNAL))
{
Common.CAN_REPLACE_CAVE_TAGS = true;
Logger.LogInfo("CROSS-COMPATIBILITY - NoLostSignal detected");
}
Configuration.Init(Config);
new Harmony(PLUGIN_GUID).PatchAll();
SceneManager.sceneLoaded += SceneOverrides.LoadNewScene;
SceneManager.sceneUnloaded += SceneOverrides.UnloadScene;
SceneOverrides.Init();
Logger.LogInfo($"{PLUGIN_NAME} v{PLUGIN_VERSION} loaded");
}
}
}