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> /// Instead of constructor. /// </summary> public void Awake() { if (Instance != null) { Destroy(this); return; } Instance = this; toolbarButton = null; guiVisible = false; rcVisible = false; globalHidden = false; gamePaused = false; guiId = GUIUtility.GetControlID(FocusType.Passive); rcGuiId = GUIUtility.GetControlID(FocusType.Passive); config = PluginConfiguration.CreateForType <BonVoyage>(); config.load(); autoDewarp = config.GetValue <bool>("autoDewarp", false); activeRovers = new List <ActiveRover>(); wayPoints = new List <Vector3d> (); Rect sample = new Rect(); sample.width = 700; sample.height = 500; sample.center = new Vector2(Screen.width / 2, Screen.height / 2); guiRect = config.GetValue <Rect>("guiRect", new Rect(sample)); sample.width = 400; sample.height = 500; sample.center = new Vector2(Screen.width / 2, Screen.height / 2); rcRect = config.GetValue <Rect> ("rcRect", new Rect(sample)); useKSPSkin = config.GetValue <bool> ("useKSPSkin", false); useToolbar = config.GetValue <bool> ("useToolbar", false); config.save(); lastUpdated = DateTime.Now; mainWindowScrollPosition = new Vector2(0, 0); labelRect = new Rect(0, 0, Screen.width, Screen.height / 2); labelStyle = new GUIStyle(); labelStyle.stretchWidth = true; labelStyle.stretchHeight = true; labelStyle.alignment = TextAnchor.MiddleCenter; labelStyle.fontSize = Screen.height / 20; labelStyle.fontStyle = FontStyle.Bold; labelStyle.normal.textColor = Color.red; // mapMarker = GameDatabase.Instance.GetTexture("BonVoyage/Textures/map-marker", false); }