UI: Fixed a number of minor UI issues with cheat finder

This commit is contained in:
Souryo 2017-09-06 21:41:15 -04:00
parent 5b8a37e392
commit 6726e9e5a9
5 changed files with 20 additions and 18 deletions

View file

@ -19,7 +19,7 @@ namespace Mesen.GUI.Debugger.Controls
public ctrlAddressList()
{
InitializeComponent();
this.ctrlDataViewer.MarginWidth = 3;
this.ctrlDataViewer.MarginWidth = 5;
this.ctrlDataViewer.FontSize = BaseControl.DefaultFontSize;
}
@ -33,6 +33,7 @@ namespace Mesen.GUI.Debugger.Controls
this.ctrlDataViewer.Header = null;
this.ctrlDataViewer.TextLines = values.Select(val => val.ToString("X2")).ToArray();
this.ctrlDataViewer.LineNumbers = addresses;
this.ctrlDataViewer.LineIndentations = values.Select(val => 3).ToArray();
_addresses = addresses;
}

View file

@ -63,7 +63,7 @@
//
// tmrRefresh
//
this.tmrRefresh.Enabled = true;
this.tmrRefresh.Enabled = false;
this.tmrRefresh.Tick += new System.EventHandler(this.tmrRefresh_Tick);
//
// grpFilters

View file

@ -32,7 +32,7 @@ namespace Mesen.GUI.Forms.Cheats
private List<byte[]> _memorySnapshots;
private List<FilterInfo> _filters;
private bool _tabIsFocused = true;
private bool _tabIsFocused = false;
private enum CheatPrevFilterType
{
@ -70,6 +70,7 @@ namespace Mesen.GUI.Forms.Cheats
if(LicenseManager.UsageMode != LicenseUsageMode.Designtime) {
Reset();
tmrRefresh.Start();
}
}
@ -99,8 +100,6 @@ namespace Mesen.GUI.Forms.Cheats
byte[] memory = InteropEmu.DebugGetInternalRam();
if(release) {
InteropEmu.DebugRelease();
} else {
System.Diagnostics.Debug.Print("test");
}
return memory;
@ -108,7 +107,9 @@ namespace Mesen.GUI.Forms.Cheats
private void tmrRefresh_Tick(object sender, EventArgs e)
{
RefreshAddressList();
if(_tabIsFocused) {
RefreshAddressList();
}
}
private void RefreshAddressList()

View file

@ -59,9 +59,9 @@ namespace Mesen.GUI.Forms.Cheats
this.btnExportGame = new System.Windows.Forms.ToolStripMenuItem();
this.btnExportSelectedCheats = new System.Windows.Forms.ToolStripMenuItem();
this.tpgCheatFinder = new System.Windows.Forms.TabPage();
this.ctrlCheatFinder = new Mesen.GUI.Forms.Cheats.ctrlCheatFinder();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.chkDisableCheats = new System.Windows.Forms.CheckBox();
this.ctrlCheatFinder = new Mesen.GUI.Forms.Cheats.ctrlCheatFinder();
this.baseConfigPanel.SuspendLayout();
this.tabMain.SuspendLayout();
this.tabCheats.SuspendLayout();
@ -95,6 +95,7 @@ namespace Mesen.GUI.Forms.Cheats
this.tabMain.SelectedIndex = 0;
this.tabMain.Size = new System.Drawing.Size(616, 257);
this.tabMain.TabIndex = 0;
this.tabMain.SelectedIndexChanged += new System.EventHandler(this.tabMain_SelectedIndexChanged);
//
// tabCheats
//
@ -385,6 +386,14 @@ namespace Mesen.GUI.Forms.Cheats
this.tpgCheatFinder.Text = "Cheat Finder";
this.tpgCheatFinder.UseVisualStyleBackColor = true;
//
// ctrlCheatFinder
//
this.ctrlCheatFinder.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlCheatFinder.Location = new System.Drawing.Point(3, 3);
this.ctrlCheatFinder.Name = "ctrlCheatFinder";
this.ctrlCheatFinder.Size = new System.Drawing.Size(602, 225);
this.ctrlCheatFinder.TabIndex = 0;
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 1;
@ -409,14 +418,6 @@ namespace Mesen.GUI.Forms.Cheats
this.chkDisableCheats.Text = "Disable all cheats";
this.chkDisableCheats.UseVisualStyleBackColor = true;
//
// ctrlCheatFinder
//
this.ctrlCheatFinder.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlCheatFinder.Location = new System.Drawing.Point(3, 3);
this.ctrlCheatFinder.Name = "ctrlCheatFinder";
this.ctrlCheatFinder.Size = new System.Drawing.Size(602, 225);
this.ctrlCheatFinder.TabIndex = 0;
//
// frmCheatList
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -425,9 +426,9 @@ namespace Mesen.GUI.Forms.Cheats
this.Controls.Add(this.tableLayoutPanel2);
this.MinimumSize = new System.Drawing.Size(632, 324);
this.Name = "frmCheatList";
this.ShowInTaskbar = true;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Cheats";
this.ShowInTaskbar = true;
this.Controls.SetChildIndex(this.baseConfigPanel, 0);
this.Controls.SetChildIndex(this.tableLayoutPanel2, 0);
this.baseConfigPanel.ResumeLayout(false);

View file

@ -32,11 +32,10 @@ namespace Mesen.GUI.Forms.Cheats
lstGameList.Select();
ctrlCheatFinder.OnAddCheat += CtrlCheatFinder_OnAddCheat;
tabMain.TabIndexChanged += TabMain_TabIndexChanged;
}
}
private void TabMain_TabIndexChanged(object sender, EventArgs e)
private void tabMain_SelectedIndexChanged(object sender, EventArgs e)
{
ctrlCheatFinder.TabIsFocused = (tabMain.SelectedTab == tpgCheatFinder);
}