public Maps(ObjectLocations objLocations) { this._objLocations = objLocations; _mapsList = new ObservableCollection <Map>(); AddDefaultMaps(); AddCustomMaps(); }
public void GetAvailableGameTypes() { AvailableGameTypes = new ObservableCollection <GameType>(); string[] variantFolderList = Directory.GetDirectories(ObjectLocations.getVariantsFolder_Path()); foreach (var folderpath in variantFolderList) { string foldername = new DirectoryInfo(folderpath).Name; /*For now this will be set like this. * In the future maybe a file with description and name or might be able to pull from variant file * once i have created the serializer in c++ */ AvailableGameTypes.Add(new GameType(foldername, foldername)); } }
private void FileMenu_Open_Click(object sender, RoutedEventArgs e) { string path = getEDDir(); while (Directory.GetFiles(path, "eldorado.exe").Length == 0) { MessageBox.Show( "This doesnt look like the ED root folder!", "Please make sure you select the root folder of Eldewrito!", MessageBoxButton.OK, MessageBoxImage.Error); path = getEDDir(); } _objectLocations = new ObjectLocations(path); Debug.WriteLine("Eldewrito location: " + _objectLocations.getRootDir_Path()); LoadFiles(); _configLoader = new ConfigLoader(_objectLocations); ConfigCount.Text = "Configs: " + _configLoader.getConfigList().Count; int index = 0; foreach (DewritoConfig dewritoConfig in _configLoader.getConfigList()) { TabItem ti = new TabItem { Header = dewritoConfig.getServerName(), Content = new ConfigView(_configLoader.getConfigBundle(index)) }; ConfigTabs.Items.Add(ti); index++; } ConfigTabs.SelectedIndex = 0; }
public ConfigBundle(int index, DewritoConfig dewritoConfig, Voting votingConfig, ObjectLocations objectLocations) { this.DewritoConfig = dewritoConfig; this.VotingConfig = votingConfig; this.Index = index; this.ObjectLocations = objectLocations; GetAvailableMaps(); GetAvailableGameTypes(); }