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, ToolDialogSettings> CommonToolSettings = new Dictionary<string, ToolDialogSettings>();
|
||||||
public Dictionary<string, Dictionary<string, object>> CustomToolSettings = new Dictionary<string, Dictionary<string, object>>();
|
public Dictionary<string, Dictionary<string, object>> CustomToolSettings = new Dictionary<string, Dictionary<string, object>>();
|
||||||
|
|
||||||
|
/*
|
||||||
// SNES Graphics Debugger Dialog Settings
|
// SNES Graphics Debugger Dialog Settings
|
||||||
public bool AutoLoadSNESGraphicsDebugger = false;
|
public bool AutoLoadSNESGraphicsDebugger = false;
|
||||||
public bool SNESGraphicsDebuggerSaveWindowPosition = true;
|
public bool SNESGraphicsDebuggerSaveWindowPosition = true;
|
||||||
|
@ -417,6 +418,7 @@ namespace BizHawk.Client.Common
|
||||||
public int SNESGraphicsDebuggerRefreshRate = 4;
|
public int SNESGraphicsDebuggerRefreshRate = 4;
|
||||||
public bool SNESGraphicsUseUserBackdropColor = false;
|
public bool SNESGraphicsUseUserBackdropColor = false;
|
||||||
public int SNESGraphicsUserBackdropColor = -1;
|
public int SNESGraphicsUserBackdropColor = -1;
|
||||||
|
*/
|
||||||
|
|
||||||
// PCE Sound Debugger settings
|
// PCE Sound Debugger settings
|
||||||
public ToolDialogSettings PceSoundDebuggerSettings = new ToolDialogSettings();
|
public ToolDialogSettings PceSoundDebuggerSettings = new ToolDialogSettings();
|
||||||
|
|
|
@ -402,11 +402,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
GlobalWin.Tools.Load<PCESoundDebugger>();
|
GlobalWin.Tools.Load<PCESoundDebugger>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Global.Config.AutoLoadSNESGraphicsDebugger)
|
|
||||||
{
|
|
||||||
GlobalWin.Tools.Load<SNESGraphicsDebugger>();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Global.Config.DisplayStatusBar == false)
|
if (Global.Config.DisplayStatusBar == false)
|
||||||
{
|
{
|
||||||
MainStatusBar.Visible = 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
|
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>();
|
List<DisplayTypeItem> displayTypeItems = new List<DisplayTypeItem>();
|
||||||
|
|
||||||
public bool UpdateBefore { get { return false; } }
|
public bool UpdateBefore { get { return false; } }
|
||||||
|
@ -50,6 +47,16 @@ namespace BizHawk.Client.EmuHawk
|
||||||
[RequiredService]
|
[RequiredService]
|
||||||
private LibsnesCore Emulator { get; set; }
|
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()
|
public void Restart()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -58,7 +65,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public SNESGraphicsDebugger()
|
public SNESGraphicsDebugger()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Closing += (o, e) => SaveConfigSettings();
|
|
||||||
viewerTile.ScaleImage = true;
|
viewerTile.ScaleImage = true;
|
||||||
|
|
||||||
viewer.ScaleImage = false;
|
viewer.ScaleImage = false;
|
||||||
|
@ -101,6 +107,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
//tabctrlDetails.SelectedIndex = 1;
|
//tabctrlDetails.SelectedIndex = 1;
|
||||||
SetTab(null);
|
SetTab(null);
|
||||||
|
|
||||||
|
UserBackdropColor = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
LibsnesCore currentSnesCore;
|
LibsnesCore currentSnesCore;
|
||||||
|
@ -535,36 +543,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Close();
|
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)
|
private void SNESGraphicsDebugger_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
defaultWidth = Size.Width; //Save these first so that the user can restore to its original size
|
if (UserBackdropColor != -1)
|
||||||
defaultHeight = Size.Height;
|
|
||||||
|
|
||||||
if (Global.Config.SNESGraphicsDebuggerSaveWindowPosition && Global.Config.SNESGraphicsDebuggerWndx >= 0 && Global.Config.SNESGraphicsDebuggerWndy >= 0)
|
|
||||||
{
|
{
|
||||||
Location = new Point(Global.Config.SNESGraphicsDebuggerWndx, Global.Config.SNESGraphicsDebuggerWndy);
|
pnBackdropColor.BackColor = Color.FromArgb(UserBackdropColor);
|
||||||
}
|
|
||||||
|
|
||||||
checkBackdropColor.Checked = Global.Config.SNESGraphicsUseUserBackdropColor;
|
|
||||||
if (Global.Config.SNESGraphicsUserBackdropColor != -1)
|
|
||||||
{
|
|
||||||
pnBackdropColor.BackColor = Color.FromArgb(Global.Config.SNESGraphicsUserBackdropColor);
|
|
||||||
}
|
}
|
||||||
if (checkBackdropColor.Checked)
|
if (checkBackdropColor.Checked)
|
||||||
{
|
{
|
||||||
|
@ -574,12 +557,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
UpdateToolsLoadstate();
|
UpdateToolsLoadstate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveConfigSettings()
|
|
||||||
{
|
|
||||||
Global.Config.SNESGraphicsDebuggerWndx = Location.X;
|
|
||||||
Global.Config.SNESGraphicsDebuggerWndy = Location.Y;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool suppression = false;
|
bool suppression = false;
|
||||||
private void rbBGX_CheckedChanged(object sender, EventArgs e)
|
private void rbBGX_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -1268,7 +1245,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void checkBackdropColor_CheckedChanged(object sender, EventArgs e)
|
private void checkBackdropColor_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Global.Config.SNESGraphicsUseUserBackdropColor = checkBackdropColor.Checked;
|
|
||||||
SyncBackdropColor();
|
SyncBackdropColor();
|
||||||
RegenerateData();
|
RegenerateData();
|
||||||
}
|
}
|
||||||
|
@ -1280,7 +1256,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (cd.ShowDialog(this) == DialogResult.OK)
|
if (cd.ShowDialog(this) == DialogResult.OK)
|
||||||
{
|
{
|
||||||
pnBackdropColor.BackColor = cd.Color;
|
pnBackdropColor.BackColor = cd.Color;
|
||||||
Global.Config.SNESGraphicsUserBackdropColor = pnBackdropColor.BackColor.ToArgb();
|
UserBackdropColor = pnBackdropColor.BackColor.ToArgb();
|
||||||
SyncBackdropColor();
|
SyncBackdropColor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue