private void Start() { Logger.Info($"Starting {ModName} v{Version}..."); var resourceProvider = new ResourceProvider(ModName); Logger.Debug("Loading configuration"); m_configuration = ConfigurationParser.LoadFromFile(ConfigurationFile); m_configuration.PropertyChanged += OnConfigurationChanged; m_toggleButton = m_configuration.ToggleKey; Logger.Debug("Setting up OrbitVisibilityController"); m_visibilityController = new OrbitVisibilityController(m_configuration); m_visibilityController.OnVisibilityChanged += OnOrbitVisibilityChanged; // setup window Logger.Debug("Creating window"); m_window = new ConfigurationWindow(ModName, m_configuration, m_visibilityController, resourceProvider); // setup toolbar button Logger.Debug("Creating toolbar button"); m_toolbarButton = new ToolbarButton(resourceProvider); m_toolbarButton.OnEnable += m_window.Show; m_toolbarButton.OnDisable += m_window.Hide; // get notifcations when player changes to map view MapView.OnEnterMapView += OnEnterMapView; MapView.OnExitMapView += OnExitMapView; // disable script until woken up by entering map view enabled = false; }
internal void Start() { Log.Info("TooManyOrbitsCoreModule.Start"); Instance = this; resourceProvider = new ResourceProvider(ModName); m_configuration = ConfigurationParser.LoadFromFile(ConfigurationFile); m_configuration.PropertyChanged += OnConfigurationChanged; m_toggleButton = m_configuration.ToggleKey; m_visibilityController = new OrbitVisibilityController(m_configuration); m_visibilityController.OnVisibilityChanged += OnOrbitVisibilityChanged; // setup window Log.Debug("Creating window"); m_window = new ConfigurationWindow(ModName, m_configuration, m_visibilityController, resourceProvider); // setup toolbar button Log.Debug("Creating toolbar button"); if (toolbarControl == null) { BuildButton(); } #if false if (HighLogic.LoadedScene == GameScenes.TRACKSTATION) { OnEnterMapView(); } else #endif { // get notifcations when player changes to map view MapView.OnEnterMapView += OnEnterMapView; MapView.OnExitMapView += OnExitMapView; } // disable script until woken up by entering map view //enabled = false; DontDestroyOnLoad(this); }