From 061f84ef2bd54699e65206b28e8a431f7b7af438 Mon Sep 17 00:00:00 2001 From: Sour Date: Sat, 28 Jul 2018 22:08:12 -0400 Subject: [PATCH] Debugger: PPU Viewer - Save palette/highlight dropdown selection --- GUI.NET/Config/DebugInfo.cs | 2 ++ GUI.NET/Debugger/Controls/ctrlChrViewer.cs | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/GUI.NET/Config/DebugInfo.cs b/GUI.NET/Config/DebugInfo.cs index 28f69758..57ff2a6d 100644 --- a/GUI.NET/Config/DebugInfo.cs +++ b/GUI.NET/Config/DebugInfo.cs @@ -188,6 +188,8 @@ namespace Mesen.GUI.Config public bool NtViewerHighlightTileUpdates = false; public bool NtViewerHighlightAttributeUpdates = false; + public int ChrViewerSelectedPalette = 0; + public CdlHighlightType ChrViewerHighlightType = CdlHighlightType.None; public bool ChrViewerUseAutoPalette = true; public bool ChrViewerUseLargeSprites = false; public bool ChrViewerShowSingleColorTilesInGrayscale = false; diff --git a/GUI.NET/Debugger/Controls/ctrlChrViewer.cs b/GUI.NET/Debugger/Controls/ctrlChrViewer.cs index fedafd5e..ccbc84e4 100644 --- a/GUI.NET/Debugger/Controls/ctrlChrViewer.cs +++ b/GUI.NET/Debugger/Controls/ctrlChrViewer.cs @@ -44,9 +44,6 @@ namespace Mesen.GUI.Debugger.Controls bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime); if(!designMode) { - this.cboPalette.SelectedIndex = 0; - this.cboHighlightType.SelectedIndex = 0; - this.picTile.Cursor = new Cursor(Properties.Resources.Pencil.GetHicon()); this.toolTip.SetToolTip(this.picTileTooltip, "Click on the tile to draw with the selected color." + Environment.NewLine + "Right button draws the background color."); @@ -57,6 +54,8 @@ namespace Mesen.GUI.Debugger.Controls this.ctrlTilePalette.HighlightMouseOver = true; this.ctrlTilePalette.DisplayIndexes = false; + this.cboPalette.SelectedIndex = ConfigManager.Config.DebugInfo.ChrViewerSelectedPalette; + this.cboHighlightType.SelectedIndex = (int)ConfigManager.Config.DebugInfo.ChrViewerHighlightType; this.chkAutoPalette.Checked = ConfigManager.Config.DebugInfo.ChrViewerUseAutoPalette; this.chkLargeSprites.Checked = ConfigManager.Config.DebugInfo.ChrViewerUseLargeSprites; this.chkShowSingleColorTilesInGrayscale.Checked = ConfigManager.Config.DebugInfo.ChrViewerShowSingleColorTilesInGrayscale; @@ -215,6 +214,10 @@ namespace Mesen.GUI.Debugger.Controls private void cboPalette_SelectedIndexChanged(object sender, EventArgs e) { this._selectedPalette = this.cboPalette.SelectedIndex; + + ConfigManager.Config.DebugInfo.ChrViewerSelectedPalette = this._selectedPalette; + ConfigManager.ApplyChanges(); + this.GetData(); this.RefreshViewer(); } @@ -253,6 +256,10 @@ namespace Mesen.GUI.Debugger.Controls private void cboHighlightType_SelectedIndexChanged(object sender, EventArgs e) { this._highlightType = (CdlHighlightType)this.cboHighlightType.SelectedIndex; + + ConfigManager.Config.DebugInfo.ChrViewerHighlightType = this._highlightType; + ConfigManager.ApplyChanges(); + this.GetData(); this.RefreshViewer(); }