snes graphics debugger: use autoconfig
This commit is contained in:
parent
e80de55210
commit
87c064c6ac
|
@ -409,6 +409,7 @@ namespace BizHawk.Client.Common
|
|||
public Dictionary<string, ToolDialogSettings> CommonToolSettings = new Dictionary<string, ToolDialogSettings>();
|
||||
public Dictionary<string, Dictionary<string, object>> CustomToolSettings = new Dictionary<string, Dictionary<string, object>>();
|
||||
|
||||
/*
|
||||
// SNES Graphics Debugger Dialog Settings
|
||||
public bool AutoLoadSNESGraphicsDebugger = false;
|
||||
public bool SNESGraphicsDebuggerSaveWindowPosition = true;
|
||||
|
@ -417,6 +418,7 @@ namespace BizHawk.Client.Common
|
|||
public int SNESGraphicsDebuggerRefreshRate = 4;
|
||||
public bool SNESGraphicsUseUserBackdropColor = false;
|
||||
public int SNESGraphicsUserBackdropColor = -1;
|
||||
*/
|
||||
|
||||
// PCE Sound Debugger settings
|
||||
public ToolDialogSettings PceSoundDebuggerSettings = new ToolDialogSettings();
|
||||
|
|
|
@ -402,11 +402,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
GlobalWin.Tools.Load<PCESoundDebugger>();
|
||||
}
|
||||
|
||||
if (Global.Config.AutoLoadSNESGraphicsDebugger)
|
||||
{
|
||||
GlobalWin.Tools.Load<SNESGraphicsDebugger>();
|
||||
}
|
||||
|
||||
if (Global.Config.DisplayStatusBar == false)
|
||||
{
|
||||
MainStatusBar.Visible = false;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -37,11 +37,8 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public unsafe partial class SNESGraphicsDebugger : Form, IToolForm
|
||||
public unsafe partial class SNESGraphicsDebugger : Form, IToolFormAutoConfig
|
||||
{
|
||||
int defaultWidth; //For saving the default size of the dialog, so the user can restore if desired
|
||||
int defaultHeight;
|
||||
|
||||
List<DisplayTypeItem> displayTypeItems = new List<DisplayTypeItem>();
|
||||
|
||||
public bool UpdateBefore { get { return false; } }
|
||||
|
@ -50,6 +47,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
[RequiredService]
|
||||
private LibsnesCore Emulator { get; set; }
|
||||
|
||||
[ConfigPersist]
|
||||
public bool UseUserBackdropColor
|
||||
{
|
||||
get { return checkBackdropColor.Checked; }
|
||||
set { checkBackdropColor.Checked = value; }
|
||||
}
|
||||
[ConfigPersist]
|
||||
public int UserBackdropColor { get; set; }
|
||||
|
||||
|
||||
public void Restart()
|
||||
{
|
||||
|
||||
|
@ -58,7 +65,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
public SNESGraphicsDebugger()
|
||||
{
|
||||
InitializeComponent();
|
||||
Closing += (o, e) => SaveConfigSettings();
|
||||
viewerTile.ScaleImage = true;
|
||||
|
||||
viewer.ScaleImage = false;
|
||||
|
@ -101,6 +107,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
//tabctrlDetails.SelectedIndex = 1;
|
||||
SetTab(null);
|
||||
|
||||
UserBackdropColor = -1;
|
||||
}
|
||||
|
||||
LibsnesCore currentSnesCore;
|
||||
|
@ -535,36 +543,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
Close();
|
||||
}
|
||||
|
||||
private void optionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
autoloadToolStripMenuItem.Checked = Global.Config.AutoLoadSNESGraphicsDebugger;
|
||||
saveWindowPositionToolStripMenuItem.Checked = Global.Config.SNESGraphicsDebuggerSaveWindowPosition;
|
||||
}
|
||||
|
||||
private void autoloadToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.AutoLoadSNESGraphicsDebugger ^= true;
|
||||
}
|
||||
|
||||
private void saveWindowPositionToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.SNESGraphicsDebuggerSaveWindowPosition ^= true;
|
||||
}
|
||||
|
||||
private void SNESGraphicsDebugger_Load(object sender, EventArgs e)
|
||||
{
|
||||
defaultWidth = Size.Width; //Save these first so that the user can restore to its original size
|
||||
defaultHeight = Size.Height;
|
||||
|
||||
if (Global.Config.SNESGraphicsDebuggerSaveWindowPosition && Global.Config.SNESGraphicsDebuggerWndx >= 0 && Global.Config.SNESGraphicsDebuggerWndy >= 0)
|
||||
if (UserBackdropColor != -1)
|
||||
{
|
||||
Location = new Point(Global.Config.SNESGraphicsDebuggerWndx, Global.Config.SNESGraphicsDebuggerWndy);
|
||||
}
|
||||
|
||||
checkBackdropColor.Checked = Global.Config.SNESGraphicsUseUserBackdropColor;
|
||||
if (Global.Config.SNESGraphicsUserBackdropColor != -1)
|
||||
{
|
||||
pnBackdropColor.BackColor = Color.FromArgb(Global.Config.SNESGraphicsUserBackdropColor);
|
||||
pnBackdropColor.BackColor = Color.FromArgb(UserBackdropColor);
|
||||
}
|
||||
if (checkBackdropColor.Checked)
|
||||
{
|
||||
|
@ -574,12 +557,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
UpdateToolsLoadstate();
|
||||
}
|
||||
|
||||
private void SaveConfigSettings()
|
||||
{
|
||||
Global.Config.SNESGraphicsDebuggerWndx = Location.X;
|
||||
Global.Config.SNESGraphicsDebuggerWndy = Location.Y;
|
||||
}
|
||||
|
||||
bool suppression = false;
|
||||
private void rbBGX_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -1268,7 +1245,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void checkBackdropColor_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.SNESGraphicsUseUserBackdropColor = checkBackdropColor.Checked;
|
||||
SyncBackdropColor();
|
||||
RegenerateData();
|
||||
}
|
||||
|
@ -1280,7 +1256,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (cd.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
pnBackdropColor.BackColor = cd.Color;
|
||||
Global.Config.SNESGraphicsUserBackdropColor = pnBackdropColor.BackColor.ToArgb();
|
||||
UserBackdropColor = pnBackdropColor.BackColor.ToArgb();
|
||||
SyncBackdropColor();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue