public override void Initialize() { if (Instance != null) { Log("Warning: " + this.GetType().Name + " is a singleton. Trying to create more than one may cause issues!"); return; } Instance = this; comms = new CommunicationNode(); comms.EnableNode(this); //Must manually set these for them to show up in the config file //I know this looks super wonky but it's the current best way to handle this GlobalSettings.GatheringSwarmChanges = GlobalSettings.GatheringSwarmChanges; GlobalSettings.WaywardCompassChanges = GlobalSettings.WaywardCompassChanges; GlobalSettings.HeavyBlowChanges = GlobalSettings.HeavyBlowChanges; Log(this.GetType().Name + " initializing!"); SetupDefaulSettings(); UnRegisterCallbacks(); RegisterCallbacks(); Log(this.GetType().Name + " is done initializing!"); }
///Revert all changes the mod has made public void Unload() { UnRegisterCallbacks(); comms.DisableNode(); Instance = null; }