public void OnSettingsUI(UIHelperBase helper) { if (string.IsNullOrEmpty(modPath)) { helper?.AddGroup(NoWorkshopMessage); return; } if (helper == null || configProvider == null) { return; } if (configProvider.Configuration == null) { Log.Warning("The 'Stops and Stations' mod wants to display the configuration page, but the configuration is unexpectedly missing."); configProvider.LoadDefaultConfiguration(); } IViewItemFactory itemFactory = new CitiesViewItemFactory(helper); CloseConfigUI(); configUI = ConfigUI.Create(configProvider, itemFactory); ApplyLanguage(); }
private void CloseConfigUI() { if (configUI != null) { configUI.Close(); configUI = null; } }