public BreakpointManager() { _settings = LoadSettings(); _saveName = _settings.SaveFile; _bpCells = new ObservableCollection <Cells> { }; _bpSearchCells = new ObservableCollection <Cells> { }; AddShowAllToList(); _bpClass = new ObservableCollection <Breakpoint> { }; if (!LoadXML()) { // error if xml loaded incorrectly MessageBox.Show("There was an error loading the data file", "Data file corrupt"); Application.Current.Shutdown(); } // listSearch is the itemsource for the for the breakpoint list on the main form. _listSearch = new ObservableCollection <Breakpoint>(_bpClass); // after this bool is true we know BPCells and BPClass is filled so can start checking if there is changes made to them. finishedLoading = true; }
public settingsWindow(BreakpointManager bpm) { InitializeComponent(); this.bpm = bpm; editSettings = this.bpm._settings; textSaveFile.Text = editSettings.SaveFile; }
static Initialization() { try { HarmonyPatches.HPatcher.Init(); ClassInjector.Initialize(); BPSettings.Init(); SettingsMenu.Init(); HunamoidRaceCheck.SearchMod(); ClassInjector.EnableDevMode(Prefs.DevMode); } catch (Exception e) { Log.Error($"BadPeople: Failed to initialize: {e.Message}"); } }
private void saveProgress() { BPSettings bp = new BPSettings(); var set_path = ProjectConfig.projectPath + "//" + "settings.json"; try { var se = bp.ReadSettings(set_path); var i = se.FindIndex(x => x.property == "progress"); se[i].value = ProjectConfig.projectSettings["progress"]; using (StreamWriter file = File.CreateText(set_path)) { JsonSerializer serializer = new JsonSerializer(); serializer.Serialize(file, se); } } catch (Exception e) { MessageBox.Show("Exception: " + e.Message); } }
private void ModifyBt_Click(object sender, EventArgs e) { BPSettings bps = new BPSettings(); var set_path = ProjectConfig.projectPath + "//" + "settings.json"; try { var se = bps.ReadSettings(set_path); var i = se.FindIndex(x => x.property == "Title"); se[i].value = projectName.Text; using (StreamWriter file = File.CreateText(set_path)) { JsonSerializer serializer = new JsonSerializer(); serializer.Serialize(file, se); } newName = projectName.Text; } catch (Exception ex) { MessageBox.Show("Exception: " + ex.Message); } }