Ram Watch - option for the Previous column to show change from previous, rather than previous value (and save setting in config)

This commit is contained in:
andres.delikat 2011-02-24 16:51:31 +00:00
parent a1234fb428
commit f912e9976a
3 changed files with 65 additions and 31 deletions

View File

@ -56,6 +56,7 @@
public int RamWatchHeight = -1; public int RamWatchHeight = -1;
public bool RamWatchShowChangeColumn = true; public bool RamWatchShowChangeColumn = true;
public bool RamWatchShowPrevColumn = false; public bool RamWatchShowPrevColumn = false;
public bool RamWatchShowChangeFromPrev = true;
// RamSearch Settings // RamSearch Settings
public bool AutoLoadRamSearch = false; public bool AutoLoadRamSearch = false;

View File

@ -57,6 +57,7 @@
this.moveDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.moveDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.showChangeCountsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.showChangeCountsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.showPreviousValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.restoreWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.restoreWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.WatchListView = new BizHawk.VirtualListView(); this.WatchListView = new BizHawk.VirtualListView();
this.Address = new System.Windows.Forms.ColumnHeader(); this.Address = new System.Windows.Forms.ColumnHeader();
@ -90,7 +91,7 @@
this.MoveDownStripButton1 = new System.Windows.Forms.ToolStripButton(); this.MoveDownStripButton1 = new System.Windows.Forms.ToolStripButton();
this.WatchCountLabel = new System.Windows.Forms.Label(); this.WatchCountLabel = new System.Windows.Forms.Label();
this.MessageLabel = new System.Windows.Forms.Label(); this.MessageLabel = new System.Windows.Forms.Label();
this.showPreviousValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.prevValueShowsChangeAmountToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout();
this.toolStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout();
@ -312,24 +313,33 @@
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.showChangeCountsToolStripMenuItem, this.showChangeCountsToolStripMenuItem,
this.showPreviousValueToolStripMenuItem, this.showPreviousValueToolStripMenuItem,
this.restoreWindowSizeToolStripMenuItem}); this.restoreWindowSizeToolStripMenuItem,
this.prevValueShowsChangeAmountToolStripMenuItem});
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20); this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
this.optionsToolStripMenuItem.Text = "&Options"; this.optionsToolStripMenuItem.Text = "&Options";
this.optionsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.optionsToolStripMenuItem_DropDownOpened);
// //
// showChangeCountsToolStripMenuItem // showChangeCountsToolStripMenuItem
// //
this.showChangeCountsToolStripMenuItem.Checked = true; this.showChangeCountsToolStripMenuItem.Checked = true;
this.showChangeCountsToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.showChangeCountsToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.showChangeCountsToolStripMenuItem.Name = "showChangeCountsToolStripMenuItem"; this.showChangeCountsToolStripMenuItem.Name = "showChangeCountsToolStripMenuItem";
this.showChangeCountsToolStripMenuItem.Size = new System.Drawing.Size(188, 22); this.showChangeCountsToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
this.showChangeCountsToolStripMenuItem.Text = "Show Change Counts"; this.showChangeCountsToolStripMenuItem.Text = "Show Change Counts";
this.showChangeCountsToolStripMenuItem.Click += new System.EventHandler(this.showChangeCountsToolStripMenuItem_Click); this.showChangeCountsToolStripMenuItem.Click += new System.EventHandler(this.showChangeCountsToolStripMenuItem_Click);
// //
// showPreviousValueToolStripMenuItem
//
this.showPreviousValueToolStripMenuItem.Name = "showPreviousValueToolStripMenuItem";
this.showPreviousValueToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
this.showPreviousValueToolStripMenuItem.Text = "Show Previous Value";
this.showPreviousValueToolStripMenuItem.Click += new System.EventHandler(this.showPreviousValueToolStripMenuItem_Click);
//
// restoreWindowSizeToolStripMenuItem // restoreWindowSizeToolStripMenuItem
// //
this.restoreWindowSizeToolStripMenuItem.Name = "restoreWindowSizeToolStripMenuItem"; this.restoreWindowSizeToolStripMenuItem.Name = "restoreWindowSizeToolStripMenuItem";
this.restoreWindowSizeToolStripMenuItem.Size = new System.Drawing.Size(188, 22); this.restoreWindowSizeToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
this.restoreWindowSizeToolStripMenuItem.Text = "Restore Window Size"; this.restoreWindowSizeToolStripMenuItem.Text = "Restore Window Size";
this.restoreWindowSizeToolStripMenuItem.Click += new System.EventHandler(this.restoreWindowSizeToolStripMenuItem_Click); this.restoreWindowSizeToolStripMenuItem.Click += new System.EventHandler(this.restoreWindowSizeToolStripMenuItem_Click);
// //
@ -635,12 +645,12 @@
this.MessageLabel.TabIndex = 5; this.MessageLabel.TabIndex = 5;
this.MessageLabel.Text = " "; this.MessageLabel.Text = " ";
// //
// showPreviousValueToolStripMenuItem // prevValueShowsChangeAmountToolStripMenuItem
// //
this.showPreviousValueToolStripMenuItem.Name = "showPreviousValueToolStripMenuItem"; this.prevValueShowsChangeAmountToolStripMenuItem.Name = "prevValueShowsChangeAmountToolStripMenuItem";
this.showPreviousValueToolStripMenuItem.Size = new System.Drawing.Size(188, 22); this.prevValueShowsChangeAmountToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
this.showPreviousValueToolStripMenuItem.Text = "Show Previous Value"; this.prevValueShowsChangeAmountToolStripMenuItem.Text = "Prev Value - Show change";
this.showPreviousValueToolStripMenuItem.Click += new System.EventHandler(this.showPreviousValueToolStripMenuItem_Click); this.prevValueShowsChangeAmountToolStripMenuItem.Click += new System.EventHandler(this.prevValueShowsChangeAmountToolStripMenuItem_Click);
// //
// RamWatch // RamWatch
// //
@ -736,5 +746,6 @@
private System.Windows.Forms.ToolStripMenuItem showChangeCountsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem showChangeCountsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem restoreWindowSizeToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem restoreWindowSizeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem showPreviousValueToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem showPreviousValueToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem prevValueShowsChangeAmountToolStripMenuItem;
} }
} }

View File

@ -21,7 +21,7 @@ namespace BizHawk.MultiClient
//DisplayWatches needs to do value display properly like updatevalues, or just run update values //DisplayWatches needs to do value display properly like updatevalues, or just run update values
//Ability to watch in different memory domains //Ability to watch in different memory domains
//Save column widths in config //Save column widths in config
//Option for Prev to show change (+2 or -2) etc //Column options in context menu
int defaultWidth; //For saving the default size of the dialog, so the user can restore if desired int defaultWidth; //For saving the default size of the dialog, so the user can restore if desired
int defaultHeight; int defaultHeight;
@ -129,6 +129,16 @@ namespace BizHawk.MultiClient
if (watchList[index].type == atype.SEPARATOR) if (watchList[index].type == atype.SEPARATOR)
text = ""; text = "";
else else
{
if (Global.Config.RamWatchShowChangeFromPrev)
{
int x = watchList[index].value - watchList[index].prev;
if (x < 0)
text = x.ToString();
else
text = "+" + x.ToString();
}
else
{ {
switch (watchList[index].signed) switch (watchList[index].signed)
{ {
@ -155,6 +165,7 @@ namespace BizHawk.MultiClient
} }
} }
} }
}
if (column == 3) //Change Counts if (column == 3) //Change Counts
{ {
text = watchList[index].changecount.ToString(); text = watchList[index].changecount.ToString();
@ -971,5 +982,16 @@ namespace BizHawk.MultiClient
Global.Config.RamWatchShowPrevColumn ^= true; Global.Config.RamWatchShowPrevColumn ^= true;
SetPrevColumn(Global.Config.RamWatchShowPrevColumn); SetPrevColumn(Global.Config.RamWatchShowPrevColumn);
} }
private void prevValueShowsChangeAmountToolStripMenuItem_Click(object sender, EventArgs e)
{
Global.Config.RamWatchShowChangeFromPrev ^= true;
DisplayWatchList();
}
private void optionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
{
prevValueShowsChangeAmountToolStripMenuItem.Checked = Global.Config.RamWatchShowChangeFromPrev;
}
} }
} }