protected void Start() { const float WINDOW_VERTICAL_POSITION = 36; this.pluginConfiguration.load(); if (MapViewFiltering.vesselTypeFilter != MapViewFiltering.VesselTypeFilter.All) { ManeuverQueue.savedFilterState = MapViewFiltering.vesselTypeFilter; } else { ManeuverQueue.savedFilterState = (MapViewFiltering.VesselTypeFilter) this.pluginConfiguration.GetValue(ManeuverQueue.configurationFiltersKey, (int)MapViewFiltering.VesselTypeFilter.All); } this.pluginConfiguration.SetValue(ManeuverQueue.configurationFiltersKey, (int)MapViewFiltering.VesselTypeFilter.All); this.pluginConfiguration.save(); this.spaceTrackingScene = (SpaceTracking)UnityEngine.Object.FindObjectOfType(typeof(SpaceTracking)); this.sideBarRect = GetSideBarRect(); this.windowPos = new Rect(this.sideBarRect.xMax, WINDOW_VERTICAL_POSITION, 10, 10); this.windowStyle = new GUIStyle(HighLogic.Skin.window) { margin = new RectOffset(), padding = new RectOffset(5, 5, 5, 5) }; GameEvents.onGameSceneSwitchRequested.Add(this.onGameSceneSwitchRequested); GameEvents.onVesselDestroy.Add(this.onVesselDestroy); GameEvents.onVesselCreate.Add(this.onVesselCreate); GameEvents.onKnowledgeChanged.Add(this.onKnowledgeChanged); GameEvents.OnMapViewFiltersModified.Add(this.onMapViewFiltersModified); ManeuverQueue.filterModeLabels = Enum.GetValues(typeof(FilterMode)).Cast <FilterMode>().Where( x => x != FilterMode.Undefined).Select( x => ManeuverQueue.LabelForFilterMode(x)).ToArray(); this.currentMode = (FilterMode)this.pluginConfiguration.GetValue(ManeuverQueue.configurationModeKey, (int)FilterMode.Default); this.render = true; }
private void Start() { const float WINDOW_VERTICAL_POSITION = 36; this.spaceTrackingScene = (SpaceTracking)UnityEngine.Object.FindObjectOfType(typeof(SpaceTracking)); this.sideBarRect = GetSideBarRect(); this.windowPos = new Rect(this.sideBarRect.xMax, WINDOW_VERTICAL_POSITION, 10, 10); this.windowStyle = new GUIStyle(HighLogic.Skin.window) { margin = new RectOffset(), padding = new RectOffset(5, 5, 5, 5) }; GameEvents.onGameSceneSwitchRequested.Add(this.onGameSceneSwitchRequested); GameEvents.onVesselDestroy.Add(this.onVesselDestroy); GameEvents.onVesselCreate.Add(this.onVesselCreate); ManeuverQueue.filterModeLabels = Enum.GetValues(typeof(FilterMode)).Cast <FilterMode>().Select(x => ManeuverQueue.LabelForFilterMode(x)).ToArray(); this.currentMode = FilterMode.Default; this.render = true; }