protected override void InitCommon(IModSystemRegistry modSystemRegistry) { string sInit = "Initialising Wico Research. Version: " + CurrentModVersion; MyAPIGateway.Utilities.ShowNotification(sInit, 5000, MyFontEnum.DarkBlue); ModLog.Info(sInit); if (MyAPIGateway.Session.IsServer) { MyVisualScriptLogicProvider.SendChatMessage(sInit, "Wicorel", 0, MyFontEnum.DarkBlue); } bool bResearch = Session.SessionSettings.EnableResearch; // This works to change the setting. Session.SessionSettings.EnableResearch = true; if (!bResearch) { ModLog.Info("Research was not turned on"); } TextAPI = new HudAPIv2(); researchControl = new ResearchControl(audioSystem); researchControl.InitResearchRestrictions(); researchHacking = new ResearchHacking(researchControl, TextAPI, networkComms); networkComms.Init(audioSystem, researchControl, researchHacking); modSystemRegistry.AddCloseableModSystem(networkComms); modSystemRegistry.AddUpatableModSystem(audioSystem); MyAPIGateway.Utilities.MessageEntered += MessageEntered; }
internal void Init(QueuedAudioSystem audioSystem, ResearchControl researchControl, ResearchHacking researchHacking) { audio = audioSystem; research = researchControl; hacking = researchHacking; MyAPIGateway.Multiplayer.RegisterMessageHandler(ModId, IncomingMessage); }