Cheat Window - some more stuff implemented

This commit is contained in:
andres.delikat 2011-03-17 03:41:14 +00:00
parent fc313ea483
commit 89958f4c62
2 changed files with 31 additions and 2 deletions

View File

@ -252,6 +252,7 @@
this.duplicateToolStripMenuItem.Name = "duplicateToolStripMenuItem";
this.duplicateToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
this.duplicateToolStripMenuItem.Text = "&Duplicate";
this.duplicateToolStripMenuItem.Click += new System.EventHandler(this.duplicateToolStripMenuItem_Click);
//
// insertSeparatorToolStripMenuItem
//
@ -381,6 +382,7 @@
this.copyToolStripButton.Name = "copyToolStripButton";
this.copyToolStripButton.Size = new System.Drawing.Size(23, 22);
this.copyToolStripButton.Text = "&Duplicate";
this.copyToolStripButton.Click += new System.EventHandler(this.copyToolStripButton_Click);
//
// toolStripButtonSeparator
//

View File

@ -17,10 +17,10 @@ namespace BizHawk.MultiClient
//Input validation on address & value boxes
//Remove compare column? make it conditional? Think about this
//Set address box text load based on memory domain size
//Recent files
//Memory domains
//File format - saving & loading
//Shortcuts for Cheat menu items
//Edit button enabled conditionally on highlighted listview item
int defaultWidth; //For saving the default size of the dialog, so the user can restore if desired
int defaultHeight;
@ -103,7 +103,6 @@ namespace BizHawk.MultiClient
public void AddCheat(Cheat c)
{
cheatList.Add(c);
UpdateNumberOfCheats();
DisplayCheatsList();
CheatListView.Refresh();
}
@ -196,6 +195,7 @@ namespace BizHawk.MultiClient
private void DisplayCheatsList()
{
UpdateNumberOfCheats();
CheatListView.ItemCount = cheatList.Count;
}
@ -562,5 +562,32 @@ namespace BizHawk.MultiClient
{
saveWindowPositionToolStripMenuItem.Checked = Global.Config.CheatsSaveWindowPosition;
}
private void DuplicateCheat()
{
ListView.SelectedIndexCollection indexes = CheatListView.SelectedIndices;
if (indexes.Count > 0)
{
Cheat c = new Cheat();
int x = indexes[0];
c.name = cheatList[x].name;
c.address = cheatList[x].address;
c.value = cheatList[x].value;
c.compare = cheatList[x].compare;
Changes();
cheatList.Add(c);
DisplayCheatsList();
}
}
private void copyToolStripButton_Click(object sender, EventArgs e)
{
DuplicateCheat();
}
private void duplicateToolStripMenuItem_Click(object sender, EventArgs e)
{
DuplicateCheat();
}
}
}