// Token: 0x06000AF9 RID: 2809 RVA: 0x0003C650 File Offset: 0x0003A850 private void addCodeToolStripMenuItem_Click(object sender, EventArgs e) { List <string> list = new List <string>(); container targetGameFolder = this.m_game.GetTargetGameFolder(); foreach (file current in targetGameFolder.files._files) { foreach (cheat current2 in current.Cheats) { list.Add(current2.name); } } AddCode addCode = new AddCode(list); if (addCode.ShowDialog() == DialogResult.OK) { cheat cheat = new cheat("-1", addCode.Description, addCode.Comment); cheat.code = addCode.Code; if (this.m_game.GetTargetGameFolder() == null) { MessageBox.Show(Resources.errNoSavedata, Resources.msgError); return; } string selectedSaveFile = this.GetSelectedSaveFile(); container targetGameFolder2 = this.m_game.GetTargetGameFolder(); file gameFile = this.m_game.GetGameFile(targetGameFolder2, selectedSaveFile); gameFile.Cheats.Add(cheat); this.SaveUserCheats(); this.m_bCheatsModified = true; } this.FillCheats(addCode.Description); }
// Token: 0x06000AFC RID: 2812 RVA: 0x0003CC18 File Offset: 0x0003AE18 private void editCodeToolStripMenuItem_Click(object sender, EventArgs e) { int index = this.dgCheats.SelectedRows[0].Index; file gameFile = this.m_game.GetGameFile(this.m_game.GetTargetGameFolder(), this.dgCheats.Rows[index].Cells[0].Tag.ToString()); cheat cheat = null; foreach (cheat current in gameFile.Cheats) { if (current.name == this.dgCheats.Rows[index].Cells[1].Value.ToString()) { cheat = current; break; } } if (cheat == null) { return; } List <string> list = new List <string>(); container targetGameFolder = this.m_game.GetTargetGameFolder(); foreach (file current2 in targetGameFolder.files._files) { foreach (cheat current3 in current2.Cheats) { if (current3.name != this.dgCheats.Rows[index].Cells[1].Value.ToString()) { list.Add(current3.name); } } } AddCode addCode = new AddCode(cheat, list); if (addCode.ShowDialog() == DialogResult.OK) { cheat cheat2 = new cheat("-1", addCode.Description, addCode.Comment); cheat2.code = addCode.Code; for (int i = 0; i < gameFile.Cheats.Count; i++) { if (gameFile.Cheats[i].name == this.dgCheats.Rows[index].Cells[1].Value.ToString()) { gameFile.Cheats[i] = cheat2; } } this.SaveUserCheats(); this.m_bCheatsModified = true; } this.FillCheats(addCode.Description); }