コード例 #1
0
        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;
        }
コード例 #2
0
 internal void Init(QueuedAudioSystem audioSystem, ResearchControl researchControl, ResearchHacking researchHacking)
 {
     audio    = audioSystem;
     research = researchControl;
     hacking  = researchHacking;
     MyAPIGateway.Multiplayer.RegisterMessageHandler(ModId, IncomingMessage);
 }
コード例 #3
0
        internal ResearchHacking(ResearchControl researchControl, HudAPIv2 hudTextApi, NetworkComms networkComms)
        {
            this.researchControl = researchControl;

            TextAPI = hudTextApi;

            this.networkComms = networkComms;
        }