private bool otherStabilizerPresent; // Set to true if other stabilizing mod is present #endregion /// <summary> /// Plugin constructor /// </summary> public void Awake() { if (Instance != null) { Destroy(this); return; } Instance = this; CommonWindowProperties.ActiveSkin = UISkinManager.defaultSkin; CommonWindowProperties.UnitySkin = null; CommonWindowProperties.RefreshStyles(); MainView = null; MainModel = null; mainViewVisible = false; SettingsView = null; SettingsModel = null; setttingsViewVisible = false; ControlView = null; ControlModel = null; controlViewVisible = false; toolbarButton = null; GamePaused = false; ShowUI = true; MapMode = false; lastUpdate = DateTime.Now; BVControllers = new List <BVController>(); Configuration.Load(); }
/// <summary> /// Hide control window dialog /// </summary> private void HideControlWindow() { if (ControlView != null) { ControlView.Dismiss(); ControlView = null; ControlModel.SetController(null); } }
/// <summary> /// Show control window dialog /// </summary> private void ShowControlWindow() { if (ControlView == null) { if (ControlModel == null) // Create model for the Settings View { ControlModel = new ControlWindowModel(); } if (HighLogic.LoadedSceneIsFlight) { ControlModel.SetController(GetControllerOfVessel(FlightGlobals.ActiveVessel)); } else { ControlModel.SetController(null); } ControlView = new ControlWindowView(ControlModel, ToggleControlWindow); ControlView.Show(); } }