From 6726e9e5a9fdeeef34edd2211d55c67ec050fe61 Mon Sep 17 00:00:00 2001 From: Souryo Date: Wed, 6 Sep 2017 21:41:15 -0400 Subject: [PATCH] UI: Fixed a number of minor UI issues with cheat finder --- GUI.NET/Debugger/Controls/ctrlAddressList.cs | 3 ++- .../Forms/Cheats/ctrlCheatFinder.Designer.cs | 2 +- GUI.NET/Forms/Cheats/ctrlCheatFinder.cs | 9 ++++---- GUI.NET/Forms/Cheats/frmCheatList.Designer.cs | 21 ++++++++++--------- GUI.NET/Forms/Cheats/frmCheatList.cs | 3 +-- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/GUI.NET/Debugger/Controls/ctrlAddressList.cs b/GUI.NET/Debugger/Controls/ctrlAddressList.cs index 3f978752..3737189d 100644 --- a/GUI.NET/Debugger/Controls/ctrlAddressList.cs +++ b/GUI.NET/Debugger/Controls/ctrlAddressList.cs @@ -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; } diff --git a/GUI.NET/Forms/Cheats/ctrlCheatFinder.Designer.cs b/GUI.NET/Forms/Cheats/ctrlCheatFinder.Designer.cs index 34117683..1af01367 100644 --- a/GUI.NET/Forms/Cheats/ctrlCheatFinder.Designer.cs +++ b/GUI.NET/Forms/Cheats/ctrlCheatFinder.Designer.cs @@ -63,7 +63,7 @@ // // tmrRefresh // - this.tmrRefresh.Enabled = true; + this.tmrRefresh.Enabled = false; this.tmrRefresh.Tick += new System.EventHandler(this.tmrRefresh_Tick); // // grpFilters diff --git a/GUI.NET/Forms/Cheats/ctrlCheatFinder.cs b/GUI.NET/Forms/Cheats/ctrlCheatFinder.cs index 55bb58b9..bd35a59d 100644 --- a/GUI.NET/Forms/Cheats/ctrlCheatFinder.cs +++ b/GUI.NET/Forms/Cheats/ctrlCheatFinder.cs @@ -32,7 +32,7 @@ namespace Mesen.GUI.Forms.Cheats private List _memorySnapshots; private List _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() diff --git a/GUI.NET/Forms/Cheats/frmCheatList.Designer.cs b/GUI.NET/Forms/Cheats/frmCheatList.Designer.cs index 2caa8fb0..4cab01f7 100644 --- a/GUI.NET/Forms/Cheats/frmCheatList.Designer.cs +++ b/GUI.NET/Forms/Cheats/frmCheatList.Designer.cs @@ -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); diff --git a/GUI.NET/Forms/Cheats/frmCheatList.cs b/GUI.NET/Forms/Cheats/frmCheatList.cs index c4d37a8e..76ea311f 100644 --- a/GUI.NET/Forms/Cheats/frmCheatList.cs +++ b/GUI.NET/Forms/Cheats/frmCheatList.cs @@ -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); }