Beispiel #1
0
 // Token: 0x06000AF0 RID: 2800 RVA: 0x0003BD6C File Offset: 0x00039F6C
 private void FillFileCheats(container target, file file, string saveFile)
 {
     for (int i = 0; i < file.Cheats.Count; i++)
     {
         cheat cheat = file.Cheats[i];
         int   index = this.dgCheats.Rows.Add(new DataGridViewRow());
         this.dgCheats.Rows[index].Cells[1].Value = cheat.name;
         this.dgCheats.Rows[index].Cells[2].Value = cheat.note;
         if (cheat.id == "-1")
         {
             DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle();
             dataGridViewCellStyle.ForeColor = Color.Blue;
             this.dgCheats.Rows[index].Cells[1].Style.ApplyStyle(dataGridViewCellStyle);
             this.dgCheats.Rows[index].Cells[0].Tag = "UserCheat";
             this.dgCheats.Rows[index].Cells[1].Tag = Path.GetFileName(saveFile);
             this.dgCheats.Rows[index].Tag          = file.GetParent(target);
         }
         else
         {
             this.dgCheats.Rows[index].Cells[0].Tag = saveFile;
             this.dgCheats.Rows[index].Cells[1].Tag = cheat.id;
         }
     }
     if (file.groups.Count > 0)
     {
         foreach (group current in file.groups)
         {
             this.FillGroupCheats(file, current, saveFile, 0);
         }
     }
 }
Beispiel #2
0
        // 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);
        }
Beispiel #3
0
 // Token: 0x06000114 RID: 276 RVA: 0x00009CDC File Offset: 0x00007EDC
 internal static cheat Copy(cheat cheat)
 {
     return(new cheat
     {
         id = cheat.id,
         name = cheat.name,
         note = cheat.note,
         code = cheat.code
     });
 }
Beispiel #4
0
        // 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);
        }
        // Token: 0x0600002D RID: 45 RVA: 0x00004770 File Offset: 0x00002970
        private void lstCheats_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.m_bTextMode)
            {
                return;
            }
            this.lstValues.Items.Clear();
            int    selectedIndex = this.lstCheats.SelectedIndex;
            string text          = this.cbSaveFiles.SelectedItem.ToString();

            if (selectedIndex >= 0)
            {
                container targetGameFolder = this.m_game.GetTargetGameFolder();
                if (targetGameFolder != null)
                {
                    foreach (file current in targetGameFolder.files._files)
                    {
                        List <string> saveFiles = this.m_game.GetSaveFiles();
                        if (saveFiles != null)
                        {
                            foreach (string current2 in saveFiles)
                            {
                                if (Path.GetFileName(current2) == text || Util.IsMatch(text, current.filename))
                                {
                                    cheat cheat = current.GetCheat(this.lstCheats.Items[selectedIndex].ToString());
                                    if (cheat != null)
                                    {
                                        string code = cheat.code;
                                        if (!string.IsNullOrEmpty(code))
                                        {
                                            string[] array = code.Trim().Split(new char[]
                                            {
                                                ' ',
                                                '\r',
                                                '\n'
                                            });
                                            for (int i = 0; i < array.Length - 1; i += 2)
                                            {
                                                this.lstValues.Items.Add(array[i] + " " + array[i + 1]);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #6
0
 // Token: 0x06000012 RID: 18 RVA: 0x000027E0 File Offset: 0x000009E0
 public AddCode(cheat item, List <string> existingCodes)
 {
     this.m_bMode         = AddCode.Mode.EDIT_MODE;
     this.m_existingCodes = existingCodes;
     this.InitializeComponent();
     this.lblDescription.Text = Resources.lblDescription;
     this.lblComment.Text     = Resources.lblComment;
     this.lblCodes.Text       = Resources.lblCodes;
     this.btnSave.Text        = Resources.btnSave;
     this.btnCancel.Text      = Resources.btnCancel;
     this.Text = Resources.titleCodeEntry;
     base.CenterToScreen();
     this.dataGridView1.CellValueChanged += new DataGridViewCellEventHandler(this.dataGridView1_CellValueChanged);
     this.dataGridView1.KeyDown          += new KeyEventHandler(this.dataGridView1_KeyDown);
     this.txtCode.Text        = item.ToEditableString();
     this.txtDescription.Text = item.name;
     this.txtComment.Text     = item.note;
 }
Beispiel #7
0
 // Token: 0x06000104 RID: 260 RVA: 0x000099FC File Offset: 0x00007BFC
 internal cheat GetCheat(string cd)
 {
     foreach (cheat current in this.Cheats)
     {
         if (cd == current.name)
         {
             cheat result = current;
             return(result);
         }
     }
     foreach (group current2 in this.groups)
     {
         cheat cheat = current2.GetCheat(cd);
         if (cheat != null)
         {
             cheat result = cheat;
             return(result);
         }
     }
     return(null);
 }
Beispiel #8
0
 // Token: 0x060000D4 RID: 212 RVA: 0x00009014 File Offset: 0x00007214
 public cheat GetCheat(string cd)
 {
     foreach (cheat current in this.cheats)
     {
         if (cd == current.name)
         {
             cheat result = current;
             return(result);
         }
     }
     if (this._group != null)
     {
         foreach (group current2 in this._group)
         {
             cheat cheat = current2.GetCheat(cd);
             if (cheat != null)
             {
                 cheat result = cheat;
                 return(result);
             }
         }
     }
     return(null);
 }