Beispiel #1
0
        /*
         * Called when the game is leaving the scene (or exiting). Perform any clean up work here.
         */
        private void OnDestroy()
        {
#if false
            toolbarControl.OnDestroy();
            Destroy(toolbarControl);
#endif
        }
Beispiel #2
0
 void OnGUIAppLauncherDestroyed()
 {
     if (toolbarControl != null)
     {
         //ApplicationLauncher.Instance.RemoveModApplication(appLauncherButton);
         toolbarControl.OnDestroy();
         Destroy(toolbarControl);
     }
 }
Beispiel #3
0
 // ****
 void removeLauncherButtons()
 {
     //Debug.Log("removeLauncherButtons");
     toolbarControl.OnDestroy();
     Destroy(toolbarControl);
     toolbarControl = null;
 }
Beispiel #4
0
        private void OnDestroy()
        {
            //Debug.Log("OnDestory");
            config.SetValue(this.name, winRect);
            config.SetValue("showAsUT", showAsUT);
            config.save();

            UnlockControls();

            toolbarControl.OnDestroy();
            Destroy(toolbarControl);

            GameEvents.onHideUI.Remove(OnHide);
            GameEvents.onShowUI.Remove(OnUnHide);
            GameEvents.onGamePause.Remove(OnHide);
            GameEvents.onGameUnpause.Remove(OnUnHide);

            if (KACWrapper.APIReady)
            {
                KACWrapper.KAC.onAlarmStateChanged -= KACWrapper_KAC_onAlarmStateChanged;
            }

            if (instance == this)
            {
                instance = null;
            }
        }
        /** Called on destroy */
        public void OnDestroy()
        {
            debugPrint("OnDestroy()");

            /** Save to config */
            PluginConfiguration config = PluginConfiguration.CreateForType <ExperimentTracker>();

            config.SetValue("expGUI", expGUI);
            config.SetValue("expListRectX", (int)expListRect.x);
            config.SetValue("expListRectY", (int)expListRect.y);
            config.SetValue("infGUI", infGUI);
            config.SetValue("infRectX", (int)infRect.x);
            config.SetValue("infRectY", (int)infRect.y);
            config.save();

            /** Unregister for events */
            //GameEvents.onGUIApplicationLauncherReady.Remove(setupButton);

            /** Remove button */
#if false
            if (etButton != null)
            {
                ApplicationLauncher.Instance.RemoveModApplication(etButton);
            }
#endif
            toolbarControl.OnDestroy();
            Destroy(toolbarControl);
        }
        IEnumerator CheckButtons()
        {
            while (true)
            {
                bool multipleDelegates = false;
                foreach (ButtonManager.SceneButton b in BtnManager.activeSceneButtons.Values)
                {
                    if (b.sortedListRef.Count > 1)
                    {
                        if (toolbarControl == null)
                        {
                            SetupToolbar();
                        }
                        multipleDelegates = true;
                        break;
                    }
                }

                if (!multipleDelegates && toolbarControl != null)
                {
                    toolbarControl.OnDestroy();
                    Destroy(toolbarControl);
                }

                yield return(new WaitForSeconds(1f));
            }
        }
Beispiel #7
0
        public override void Dispose()
        {
            this.StopGUI();

            if (this.onSkinChanged != null)
            {
                this.onSkinChanged(this);
            }
#if false
            if (this.AppLauncherButton != null)
            {
                ApplicationLauncher.Instance.RemoveModApplication(this.AppLauncherButton);
                this.AppLauncherButton = null;
            }
#endif
            if (this.toolbarControl != null)
            {
                toolbarControl.OnDestroy();
                ThisGameObject.Destroy(toolbarControl);
                this.toolbarControl = null;
            }

            _instance    = null;
            _initialized = false;
        }
Beispiel #8
0
        void OnDestroy()
        {
            Save();

            GameEvents.onShowUI.Remove(showUI);
            GameEvents.onHideUI.Remove(hideUI);

            if (_behaviour != null)
            {
                Destroy(_behaviour);
            }
#if false
            if (!_toolbarAvailable)
            {
                GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIAppLauncherReady);
                ApplicationLauncher.Instance.RemoveModApplication(stockButton);
            }
            if (_button != null)
            {
                _button.Destroy();
            }
#endif
            toolbarControl.OnDestroy();
            Destroy(toolbarControl);
        }
Beispiel #9
0
        void removeLauncherButtons()
        {
            toolbarControl.OnDestroy();

            Destroy(toolbarControl);
            toolbarControl = null;
        }
Beispiel #10
0
 void OnDestroy()
 {
     RemoveWireFrameFromSelection();
     toolbarControl.OnDestroy();
     GameEvents.onGameSceneSwitchRequested.Remove(OnSceneSwitch);
     Destroy(toolbarControl);
 }
Beispiel #11
0
 private void OnDestroy()
 {
     toolbarControl.OnDestroy();
     Destroy(toolbarControl);
     GameEvents.onEditorPartPlaced.Remove(OnVesselModified);
     GameEvents.onEditorPartPicked.Remove(OnVesselModified);
 }
Beispiel #12
0
 void NoOnDestroy()
 {
     toolbarControl.OnDestroy();
     Destroy(toolbarControl);
     toolbarControl = null;
     showGui        = false;
 }
Beispiel #13
0
        public void OnDestroy()
        {
            GameEvents.onVesselWasModified.Remove(OnVesselWasModified);
            GameEvents.onVesselChange.Remove(OnVesselChange);
            GameEvents.onVesselLoaded.Remove(OnVesselLoaded);
            GameEvents.onEditorShipModified.Remove(OnEditorShipModified);
            GameEvents.onFlightReady.Remove(OnFlightReady);
            GameEvents.onGameSceneLoadRequested.Remove(OnGameSceneLoadRequested);
            GameEvents.onEditorLoad.Remove(this.OnEditorLoad);
            GameEvents.onPartExplode.Remove(OnPartExplode);
            GameEvents.onPartExplodeGroundCollision.Remove(OnPartExplodeGroundCollision);

            if (HighLogic.LoadedSceneIsFlight)
            {
                GameEvents.onHideUI.Remove(OnHideUI);
                GameEvents.onShowUI.Remove(OnShowUI);
            }

            if (toolbarControl != null)
            {
                toolbarControl.OnDestroy();
                Destroy(toolbarControl);
            }
            _listFuelBalancers.Clear();
            _listFuelBalancers = null;
        }
        private void RemoveButtons()
        {
#if false
            if (_checklistButton != null)
            {
                _checklistButton.ButtonOn   -= ChecklistButton_Open;
                _checklistButton.ButtonOff  -= ChecklistButton_Close;
                _checklistButton.RightClick -= ChecklistButton_RightClick;
                _checklistButton.Remove();
                _checklistButton = null;
            }
            if (_statusButton != null)
            {
                _statusButton.ButtonOn  -= StatusButton_Open;
                _statusButton.ButtonOff -= StatusButton_Close;
                _statusButton.Remove();
                _statusButton = null;
            }
#endif
            if (statusToolbarControl != null)
            {
                statusToolbarControl.OnDestroy();
                Destroy(statusToolbarControl);
                statusToolbarControl = null;
            }
            if (checklistToolbarControl != null)
            {
                checklistToolbarControl.OnDestroy();
                Destroy(checklistToolbarControl);
                checklistToolbarControl = null;
            }
        }
 public void DestroyButtons()
 {
     if (toolbarControl != null)
     {
         toolbarControl.OnDestroy();
         UnityEngine.Object.Destroy(toolbarControl);
     }
 }
Beispiel #16
0
        public void remove_toolbar_button()
        {
#if false
            ApplicationLauncher.Instance.RemoveModApplication(Stock_Toolbar_Button);
#endif
            toolbarControl.OnDestroy();
            Destroy(toolbarControl);
        }
 public void OnDisable()
 {
     if (toolbarControl != null)
     {
         toolbarControl.OnDestroy();
         Destroy(toolbarControl);
     }
 }
Beispiel #18
0
 private void TeardownToolbar()
 {
     if (toolbarControl != null)
     {
         toolbarControl.OnDestroy();
         Destroy(toolbarControl);
     }
 }
Beispiel #19
0
        public void OnDestroy()
        {
            toolbarControl.OnDestroy();
            Destroy(toolbarControl);

            GameEvents.onShowUI.Remove(ShowUI);
            GameEvents.onHideUI.Remove(HideUI);
        }
 private void RemoveToolbarButton()
 {
     if (toolbarButtonAdded)
     {
         toolbarController.OnDestroy();
         Destroy(toolbarController);
     }
 }
Beispiel #21
0
 protected void OnGUIAppLauncherDestroyed()
 {
     if (toolbarControl != null)
     {
         toolbarControl.OnDestroy();
         Destroy(toolbarControl);
     }
 }
Beispiel #22
0
 private void DestroyAppIcon()
 {
     if (toolbarControl != null)
     {
         toolbarControl.OnDestroy();
         Destroy(toolbarControl);
     }
 }
 void OnDestroy()
 {
     if (toolbarControl != null)
     {
         toolbarControl.OnDestroy();
         Destroy(toolbarControl);
     }
 }
Beispiel #24
0
 public void RemoveLauncher()
 {
     if (toolbarControl != null)
     {
         toolbarControl.OnDestroy();
         Destroy(toolbarControl);
     }
 }
Beispiel #25
0
 private void RemoveToolbarButton()
 {
     if (toolbarControl != null)
     {
         toolbarControl.OnDestroy();
         Destroy(toolbarControl);
     }
 }
Beispiel #26
0
 public void OnDestroy()
 {
     if (toolbarControl != null)
     {
         toolbarControl.OnDestroy();
         Destroy(toolbarControl);
     }
     Settings.Instance.Save();
 }
 private void OnDestroy()
 {
     if (toolbarControl2 != null)
     {
         toolbarControl2.OnDestroy();
         GameObject.Destroy(toolbarControl2);
         toolbarControl2 = null;
     }
 }
 public void OnDestroy()
 {
     if (toolbarControl != null)
     {
         toolbarControl.OnDestroy();
         Destroy(toolbarControl);
         toolbarControl = null;
     }
 }
Beispiel #29
0
 void DeleteToolbarButton()
 {
     if (toolbarControl != null)
     {
         toolbarControl.OnDestroy();
         Destroy(toolbarControl);
         toolbarControl = null;
     }
 }
 void OnDestroy()
 {
     if (toolbarControl != null)
     {
         toolbarControl.OnDestroy();
         GameObject.Destroy(toolbarControl);
         toolbarControl = null;
     }
 }