mirror of
https://github.com/libretro/Mesen.git
synced 2024-12-16 05:48:05 +00:00
Cheats: Fixed "Delete Selected Cheats" button
This commit is contained in:
parent
8ac15c6f53
commit
32732caaa1
4
GUI.NET/Forms/Cheats/frmCheatList.Designer.cs
generated
4
GUI.NET/Forms/Cheats/frmCheatList.Designer.cs
generated
@ -154,7 +154,7 @@ namespace Mesen.GUI.Forms.Cheats
|
||||
this.mnuAddCheat,
|
||||
this.mnuDeleteCheat});
|
||||
this.contextMenuCheats.Name = "contextMenuCheats";
|
||||
this.contextMenuCheats.Size = new System.Drawing.Size(160, 48);
|
||||
this.contextMenuCheats.Size = new System.Drawing.Size(160, 70);
|
||||
//
|
||||
// mnuAddCheat
|
||||
//
|
||||
@ -171,6 +171,7 @@ namespace Mesen.GUI.Forms.Cheats
|
||||
this.mnuDeleteCheat.ShortcutKeys = System.Windows.Forms.Keys.Delete;
|
||||
this.mnuDeleteCheat.Size = new System.Drawing.Size(159, 22);
|
||||
this.mnuDeleteCheat.Text = "Delete";
|
||||
this.mnuDeleteCheat.Click += new System.EventHandler(this.mnuDeleteCheat_Click);
|
||||
//
|
||||
// flowLayoutPanel2
|
||||
//
|
||||
@ -205,6 +206,7 @@ namespace Mesen.GUI.Forms.Cheats
|
||||
this.btnDeleteCheat.TabIndex = 3;
|
||||
this.btnDeleteCheat.Text = "Delete Selected Cheats";
|
||||
this.btnDeleteCheat.UseVisualStyleBackColor = true;
|
||||
this.btnDeleteCheat.Click += new System.EventHandler(this.btnDeleteCheat_Click);
|
||||
//
|
||||
// tableLayoutPanel2
|
||||
//
|
||||
|
@ -87,5 +87,24 @@ namespace Mesen.GUI.Forms.Cheats
|
||||
mnuDeleteCheat.Enabled = enableDelete;
|
||||
btnDeleteCheat.Enabled = enableDelete;
|
||||
}
|
||||
|
||||
private void DeleteSelectedCheats()
|
||||
{
|
||||
foreach(var item in lstCheats.SelectedItems) {
|
||||
CheatInfo cheat = ((ListViewItem)item).Tag as CheatInfo;
|
||||
ConfigManager.Config.Cheats.Remove(cheat);
|
||||
}
|
||||
UpdateCheatList();
|
||||
}
|
||||
|
||||
private void btnDeleteCheat_Click(object sender, EventArgs e)
|
||||
{
|
||||
DeleteSelectedCheats();
|
||||
}
|
||||
|
||||
private void mnuDeleteCheat_Click(object sender, EventArgs e)
|
||||
{
|
||||
DeleteSelectedCheats();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user