private void Window_Loaded(object sender, RoutedEventArgs e) { string[] tokens = arg.Split('/'); if (tokens.Length < 4) { MessageBox.Show("Unsupported arguments...\nThe problematic arguments are:\n" + arg); } else { string author = tokens[tokens.Length - 4]; string name = tokens[tokens.Length - 3]; string version = tokens[tokens.Length - 2]; ModManager.onlineModList = onlineModList; onlineModList.RefreshCollection(); foreach (Mod mod in onlineModList.collection) { if (mod.name == name && mod.author == author) { ModManager.ActivateMod(mod, version); break; } } } }
private void InstallSelected_Click(object sender, RoutedEventArgs e) { foreach (Mod mod in DG.SelectedItems) { ModManager.ActivateMod(mod); } }
private void CheckBox_Click(object sender, RoutedEventArgs e) { foreach (Mod mod in DG.SelectedItems) { if (mod.isInstalled) { ModManager.UninstallMod(mod); } else { ModManager.ActivateMod(mod); } } }
public void Install(ModList onlineMods, bool installProfileVersions) { foreach (ProfileEntry entry in entries) { Mod mod = onlineMods.Find(entry.fullName); if (mod != null) { ModManager.ActivateMod(mod, installProfileVersions ? entry.version : null); } else { MessageBox.Show($"Could not find mod \"{entry.fullName}\"!", "Profile Load Error", MessageBoxButton.OK); } } }