private void ButtonLoadSave_Click(object sender, RoutedEventArgs e) { if (ListBoxSavesList.SelectedIndex != -1) { string selectedSave = ListBoxSavesList.SelectedItem.ToString(); if (File.Exists($"saves\\{selectedSave}.xml")) { registryEditor.ChangeRegistryKey("SaveGame1_h1867918427", File.ReadAllBytes($"saves/{selectedSave}.xml"), RegistryValueKind.Binary); registryEditor.ChangeRegistryKey("SaveGame0_h1867918426", File.ReadAllBytes($"saves/{selectedSave}.xml"), RegistryValueKind.Binary); } else { MessageBox.Show("This save doesn't exist anymore. Please reload the application.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } else { MessageBox.Show("Please select a save first!", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
public bool Set(int amount) { registryEditor.ChangeRegistryKey("NumWins_h3927849616", amount); return(Get() == amount); }