public void OnAddMod(object sender, RoutedEventArgs e) { string path = OpenFolderDialog(); guiHandler.AddMod(path); AddItemToList(this.ModList, ConfigHolder.ShortenModPath(path)); }
public void LoadAllModsInDirectory() { var directories = Directory.GetDirectories(Path.GetDirectoryName(ConfigHolder.GetProcessPath())); foreach (string s in directories) { if (ConfigHolder.IsModFolder(ConfigHolder.ShortenModPath(s))) { if (AddMod(s)) { window.AddItemToList(window.ModList, ConfigHolder.ShortenModPath(s)); } } } }
public void LoadGUI() { window.ProcessTextBox.Text = ConfigHolder.GetProcessPath(); window.KillNonRespProcessBox.IsChecked = ConfigHolder.killNonRespProcess; window.StartServerWithToolBox.IsChecked = ConfigHolder.startServerOnStartup; foreach (string s in ConfigHolder.GetParameters()) { window.AddItemToList(window.ParameterList, s); } foreach (string s in ConfigHolder.GetMods()) { window.AddItemToList(window.ModList, ConfigHolder.ShortenModPath(s)); } WriteToConsole("Config files loaded"); }
private static string ReadMods() { string parameter = "\"-mod="; for (int i = 0; i < ConfigHolder.GetMods().Count; i++) { string mod = ConfigHolder.GetMods()[i].ToString(); if (i != ConfigHolder.GetMods().Count - 1) { parameter += ConfigHolder.ShortenModPath(mod) + ";"; } else { parameter += ConfigHolder.ShortenModPath(mod); } } return(parameter += "\""); }