public override void VSMStart()
        {
            if (NotA_Vessel)
            {
                return;
            }
            if (NoCommand)
            {
                return;
            }

            Main.Log.Info("VSMStart, vessel: " + Vessel.name + ", vesselName: " + Vessel.vesselName + ", vessel.missionTime: " + vessel.missionTime + ", vessel.launchTime: " + vessel.launchTime + ", Planetarium.time: " + Planetarium.fetch.time);
            Main.Log.Info("Name from component: " + this.GetComponent <Vessel>().vesselName);

            GameEvents.onGamePause.Add(OnPause);
            GameEvents.onGameUnpause.Add(OnUnpause);

            if (vessel.missionTime == 0 && Vessel.isActiveVessel && HighLogic.CurrentGame.Parameters.CustomParams <RM_1>().applyCommonToAll)
            {
                ResourceAlertWindow.fetch.GetResourceList(Vessel);

                ResourceAlertWindow.AddCommonResourceMonitors();
            }
            StartCoroutine(MonitorThread());
        }
Exemple #2
0
        void Start()
        {
            fetch = this;
            if (toolbarControl == null)
            {
                toolbarControl = gameObject.AddComponent <ToolbarControl>();
                toolbarControl.AddToAllToolbars(GuiOn, GuiOff,
                                                ApplicationLauncher.AppScenes.SPACECENTER | ApplicationLauncher.AppScenes.FLIGHT | ApplicationLauncher.AppScenes.MAPVIEW,
                                                MODID,
                                                "dangerAlertButton",
                                                "ResourceMonitors/PluginData/Icons/icon_38",
                                                "ResourceMonitors/PluginData/Icons/icon_24",
                                                MODNAME
                                                );
            }
            if (soundplayer == null)
            {
                soundplayer = new AlertSoundPlayer();
                soundplayer.Initialize("selection");
            }
            GameEvents.onVesselChange.Add(onVesselChange);
            GameEvents.OnGameSettingsApplied.Add(OnGameSettingsApplied);

            GameEvents.onGamePause.Add(onGamePause);
            GameEvents.onGameUnpause.Add(onGameUnpause);

            GameEvents.onShowUI.Add(ShowUI);
            GameEvents.onHideUI.Add(HideUI);
        }