Add Always on Top feature to Ram Watch, fix Ram Search Always On Top feature, remove some now unused variables from the config, fix a widths bug in cheat search dialog

This commit is contained in:
adelikat 2013-09-25 23:09:39 +00:00
parent b80f5a276e
commit ebcac8f9d0
6 changed files with 51 additions and 25 deletions

View File

@ -174,6 +174,7 @@ namespace BizHawk.MultiClient
// RamWatch Settings
public RecentFiles RecentWatches = new RecentFiles(8);
public bool RamWatchSaveWindowPosition = true;
public bool RamWatchAlwaysOnTop = false;
public int RamWatchWndx = -1; //Negative numbers will be ignored even with save window position set
public int RamWatchWndy = -1;
public int RamWatchWidth = -1;
@ -183,14 +184,6 @@ namespace BizHawk.MultiClient
public bool RamWatchShowDiffColumn = false;
public bool RamWatchShowDomainColumn = true;
public int RamWatchAddressWidth = -1;
public int RamWatchValueWidth = -1;
public int RamWatchPrevWidth = -1;
public int RamWatchChangeWidth = -1;
public int RamWatchDiffWidth = -1;
public int RamWatchNotesWidth = -1;
public int RamWatchDomainWidth = -1;
public Dictionary<string, int> RamWatchColumnWidths = new Dictionary<string, int>()
{
{ "AddressColumn", -1 },
@ -213,18 +206,10 @@ namespace BizHawk.MultiClient
{ "NotesColumn", 6 },
};
public int RamWatchAddressIndex = 0;
public int RamWatchValueIndex = 1;
public int RamWatchPrevIndex = 2;
public int RamWatchChangeIndex = 3;
public int RamWatchDiffIndex = 4;
public int RamWatchDomainIndex = 5;
public int RamWatchNotesIndex = 6;
public int RamWatchPrev_Type = 1;
public Watch.PreviousType RamWatchDefinePrevious = Watch.PreviousType.LastFrame;
// RamSearch Settings
public int RamSearchPrev_Type = 1;
public bool RamSearchSaveWindowPosition = true;
public RecentFiles RecentSearches = new RecentFiles(8);
public int RamSearchWndx = -1; //Negative numbers will be ignored even with save window position set
@ -245,6 +230,25 @@ namespace BizHawk.MultiClient
public bool RamSearchFastMode = false;
public bool RamSearchAlwaysOnTop = false;
public Dictionary<string, int> RamSearchColumnWidths = new Dictionary<string, int>()
{
{ "AddressColumn", -1 },
{ "ValueColumn", -1 },
{ "PrevColumn", -1 },
{ "ChangesColumn", -1 },
{ "DiffColumn", -1 },
};
public Dictionary<string, int> RamSearchColumnIndexes = new Dictionary<string, int>()
{
{ "AddressColumn", 0 },
{ "ValueColumn", 1 },
{ "PrevColumn", 2 },
{ "ChangesColumn", 3 },
{ "DiffColumn", 4 },
};
// HexEditor Settings
public bool AutoLoadHexEditor = false;
public bool HexEditorSaveWindowPosition = true;

View File

@ -1138,12 +1138,12 @@ namespace BizHawk.MultiClient
List<KeyValuePair<int, string>> columnSettings = new List<KeyValuePair<int, string>>
{
new KeyValuePair<int, string>(Global.Config.RamWatchAddressIndex, "Name"),
new KeyValuePair<int, string>(Global.Config.RamWatchAddressIndex, "Address"),
new KeyValuePair<int, string>(Global.Config.RamWatchAddressIndex, "Value"),
new KeyValuePair<int, string>(Global.Config.RamWatchAddressIndex, "Compare"),
new KeyValuePair<int, string>(Global.Config.RamWatchAddressIndex, "Domain"),
new KeyValuePair<int, string>(Global.Config.RamWatchAddressIndex, "On")
new KeyValuePair<int, string>(Global.Config.CheatsNameIndex, "Name"),
new KeyValuePair<int, string>(Global.Config.CheatsAddressIndex, "Address"),
new KeyValuePair<int, string>(Global.Config.CheatsValueIndex, "Value"),
new KeyValuePair<int, string>(Global.Config.CheatsCompareIndex, "Compare"),
new KeyValuePair<int, string>(Global.Config.CheatsDomainIndex, "Domain"),
new KeyValuePair<int, string>(Global.Config.CheatsOnIndex, "On")
};
columnSettings = columnSettings.OrderBy(s => s.Key).ToList();

View File

@ -61,6 +61,8 @@ namespace BizHawk.MultiClient
Settings = new RamSearchEngine.Settings();
Searches = new RamSearchEngine(Settings);
TopMost = Global.Config.RamSearchAlwaysOnTop;
}
private void RamSearch_Load(object sender, EventArgs e)
@ -808,6 +810,7 @@ namespace BizHawk.MultiClient
SaveWinPositionMenuItem.Checked = Global.Config.RamSearchSaveWindowPosition;
ExcludeRamWatchMenuItem.Checked = Global.Config.RamSearchAlwaysExcludeRamWatch;
PreviewModeMenuItem.Checked = Global.Config.RamSearchPreviewMode;
AlwaysOnTopMenuItem.Checked = Global.Config.RamSearchAlwaysOnTop;
AutoSearchMenuItem.Checked = autoSearch;
}

View File

@ -2644,7 +2644,7 @@ namespace BizHawk.MultiClient
case "value":
return Searches[watch_index].ValueString;
case "prev":
switch (Global.Config.RamWatchPrev_Type)
switch (Global.Config.RamSearchPrev_Type)
{
case 1:
return Searches[watch_index].PrevString;
@ -2656,7 +2656,7 @@ namespace BizHawk.MultiClient
case "changes":
return Searches[watch_index].Changecount.ToString();
case "diff":
switch (Global.Config.RamWatchPrev_Type)
switch (Global.Config.RamSearchPrev_Type)
{
case 1:
return Searches[watch_index].DiffPrevString;

View File

@ -115,6 +115,7 @@
this.DiffColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.DomainColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.NotesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.AlwaysOnTopMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
@ -761,6 +762,7 @@
this.definePreviousValueAsToolStripMenuItem,
this.displayWatchesOnScreenToolStripMenuItem,
this.saveWindowPositionToolStripMenuItem,
this.AlwaysOnTopMenuItem,
this.toolStripSeparator7,
this.restoreWindowSizeToolStripMenuItem});
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
@ -903,6 +905,13 @@
this.NotesColumn.Text = "Notes";
this.NotesColumn.Width = 128;
//
// AlwaysOnTopMenuItem
//
this.AlwaysOnTopMenuItem.Name = "AlwaysOnTopMenuItem";
this.AlwaysOnTopMenuItem.Size = new System.Drawing.Size(217, 22);
this.AlwaysOnTopMenuItem.Text = "&Always On Top";
this.AlwaysOnTopMenuItem.Click += new System.EventHandler(this.AlwaysOnTopMenuItem_Click);
//
// RamWatch
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1019,5 +1028,6 @@
private System.Windows.Forms.ToolStripMenuItem ShowPreviousValueContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem ShowDiffContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem ShowDomainContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem AlwaysOnTopMenuItem;
}
}

View File

@ -45,6 +45,8 @@ namespace BizHawk.MultiClient
Closing += (o, e) => SaveConfigSettings();
_sortedColumn = "";
_sortReverse = false;
TopMost = Global.Config.RamWatchAlwaysOnTop;
}
public void UpdateValues()
@ -986,6 +988,7 @@ namespace BizHawk.MultiClient
{
displayWatchesOnScreenToolStripMenuItem.Checked = Global.Config.DisplayRamWatch;
saveWindowPositionToolStripMenuItem.Checked = Global.Config.RamWatchSaveWindowPosition;
AlwaysOnTopMenuItem.Checked = Global.Config.RamWatchAlwaysOnTop;
}
private void definePreviousValueAsToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
@ -1043,6 +1046,12 @@ namespace BizHawk.MultiClient
Global.Config.RamWatchSaveWindowPosition ^= true;
}
private void AlwaysOnTopMenuItem_Click(object sender, EventArgs e)
{
Global.Config.RamWatchAlwaysOnTop ^= true;
TopMost = Global.Config.RamWatchAlwaysOnTop;
}
private void restoreWindowSizeToolStripMenuItem_Click(object sender, EventArgs e)
{
Size = new Size(defaultWidth, defaultHeight);