コード例 #1
0
        public void addEvents()
        {
            GameEvents.onGUILaunchScreenSpawn.Add(launchScreenOpenEvent);
            GameEvents.onVesselRecovered.Add(vesselRecoverEvent);

            if (!StageRecoveryWrapper.StageRecoveryAvailable)
            {
                GameEvents.onVesselDestroy.Add(vesselDestroyEvent);
            }
            else
            {
                KCTDebug.Log("Deferring stage recovery to StageRecovery.");
                StageRecoveryWrapper.AddRecoverySuccessEvent(StageRecoverySuccessEvent);
            }

            //GameEvents.onLaunch.Add(vesselSituationChange);
            GameEvents.onVesselSituationChange.Add(vesselSituationChange);
            GameEvents.onGameSceneLoadRequested.Add(gameSceneEvent);
            GameEvents.onVesselSOIChanged.Add(SOIChangeEvent);
            GameEvents.OnTechnologyResearched.Add(TechUnlockEvent);
            //if (!ToolbarManager.ToolbarAvailable || !KCT_GameStates.settings.PreferBlizzyToolbar)
            GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady);
            GameEvents.onEditorShipModified.Add(ShipModifiedEvent);
            GameEvents.OnPartPurchased.Add(PartPurchasedEvent);
            GameEvents.OnVesselRecoveryRequested.Add(RecoveryRequested);
            GameEvents.onGUIRnDComplexDespawn.Add(TechDisableEvent);
            GameEvents.OnKSCFacilityUpgraded.Add(FacilityUpgradedEvent);
            GameEvents.onGameStateLoad.Add(PersistenceLoadEvent);
            //     GameEvents.OnKSCStructureRepairing.Add(FacilityRepairingEvent);
            //  GameEvents.onLevelWasLoaded.Add(LevelLoadedEvent);

            eventAdded = true;
        }
コード例 #2
0
ファイル: KCT_Events.cs プロジェクト: ts826848/KCT
        public void addEvents()
        {
            GameEvents.onGUILaunchScreenSpawn.Add(launchScreenOpenEvent);
            GameEvents.onVesselRecovered.Add(vesselRecoverEvent);
            if (StageRecoveryWrapper.StageRecoveryAvailable)
            {
                KCTDebug.Log("Deferring stage recovery to StageRecovery.");
                StageRecoveryWrapper.AddRecoverySuccessEvent(StageRecoverySuccessEvent);
            }

            //GameEvents.onLaunch.Add(vesselSituationChange);
            GameEvents.onVesselSituationChange.Add(vesselSituationChange);
            GameEvents.onGameSceneLoadRequested.Add(gameSceneEvent);
            GameEvents.onVesselSOIChanged.Add(SOIChangeEvent);
            GameEvents.OnTechnologyResearched.Add(TechUnlockEvent);
            //if (!ToolbarManager.ToolbarAvailable || !KCT_GameStates.settings.PreferBlizzyToolbar)
            GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady);
            GameEvents.onEditorShipModified.Add(ShipModifiedEvent);
            GameEvents.OnPartPurchased.Add(PartPurchasedEvent);
            //GameEvents.OnVesselRecoveryRequested.Add(RecoveryRequested);
            GameEvents.onGUIRnDComplexDespawn.Add(TechDisableEvent);
            GameEvents.OnKSCFacilityUpgraded.Add(FacilityUpgradedEvent);
            GameEvents.onGameStateLoad.Add(PersistenceLoadEvent);

            GameEvents.OnKSCStructureRepaired.Add(FaciliyRepaired);
            GameEvents.OnKSCStructureCollapsed.Add(FacilityDestroyed);
            //     GameEvents.OnKSCStructureRepairing.Add(FacilityRepairingEvent);
            //  GameEvents.onLevelWasLoaded.Add(LevelLoadedEvent);

            /*  GameEvents.OnCrewmemberHired.Add((ProtoCrewMember m, int i) =>
             * {
             *    foreach (KCT_KSC ksc in KCT_GameStates.KSCs)
             *    {
             *        ksc.RecalculateBuildRates();
             *        ksc.RecalculateUpgradedBuildRates();
             *    }
             * });
             * GameEvents.OnCrewmemberSacked.Add((ProtoCrewMember m, int i) =>
             * {
             *    foreach (KCT_KSC ksc in KCT_GameStates.KSCs)
             *    {
             *        ksc.RecalculateBuildRates();
             *        ksc.RecalculateUpgradedBuildRates();
             *    }
             * });*/

            GameEvents.onGUIAdministrationFacilitySpawn.Add(HideAllGUIs);
            GameEvents.onGUIAstronautComplexSpawn.Add(HideAllGUIs);
            GameEvents.onGUIMissionControlSpawn.Add(HideAllGUIs);
            GameEvents.onGUIRnDComplexSpawn.Add(HideAllGUIs);
            GameEvents.onGUIKSPediaSpawn.Add(HideAllGUIs);

            eventAdded = true;
        }