some nitpick cleanups

This commit is contained in:
adelikat 2020-02-03 19:56:46 -06:00
parent c0fcd01b69
commit ba7fd37ce8
2 changed files with 32 additions and 10 deletions

View File

@ -2,6 +2,7 @@
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common; using BizHawk.Client.Common;
using BizHawk.Client.EmuHawk.Filters;
using BizHawk.Common; using BizHawk.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Client.EmuHawk
@ -253,7 +254,7 @@ namespace BizHawk.Client.EmuHawk
//test the preset //test the preset
using (var stream = File.OpenRead(choice)) using (var stream = File.OpenRead(choice))
{ {
var cgp = new BizHawk.Client.EmuHawk.Filters.RetroShaderPreset(stream); var cgp = new RetroShaderPreset(stream);
if (cgp.ContainsGlsl) if (cgp.ContainsGlsl)
{ {
MessageBox.Show("Specified CGP contains references to .glsl files. This is illegal. Use .cg"); MessageBox.Show("Specified CGP contains references to .glsl files. This is illegal. Use .cg");
@ -265,7 +266,7 @@ namespace BizHawk.Client.EmuHawk
string errors = ""; string errors = "";
try try
{ {
var filter = new BizHawk.Client.EmuHawk.Filters.RetroShaderChain(GlobalWin.GL, cgp, Path.GetDirectoryName(choice)); var filter = new RetroShaderChain(GlobalWin.GL, cgp, Path.GetDirectoryName(choice));
ok = filter.Available; ok = filter.Available;
errors = filter.Errors; errors = filter.Errors;
} }
@ -287,6 +288,7 @@ namespace BizHawk.Client.EmuHawk
{ {
RefreshAspectRatioOptions(); RefreshAspectRatioOptions();
} }
private void checkPadInteger_CheckedChanged(object sender, EventArgs e) private void checkPadInteger_CheckedChanged(object sender, EventArgs e)
{ {
RefreshAspectRatioOptions(); RefreshAspectRatioOptions();
@ -321,7 +323,7 @@ namespace BizHawk.Client.EmuHawk
SyncTrackBar(); SyncTrackBar();
} }
void SyncTrackBar() private void SyncTrackBar()
{ {
if (trackbarFrameSizeWindowed.Value == 0) if (trackbarFrameSizeWindowed.Value == 0)
{ {

View File

@ -16,15 +16,24 @@ namespace BizHawk.Client.EmuHawk
InitializeComponent(); InitializeComponent();
} }
public int AutosaveSaveRAMSeconds { public int AutosaveSaveRAMSeconds
get { {
get
{
if (AutosaveSRAMradioButton1.Checked) if (AutosaveSRAMradioButton1.Checked)
{
return 5; return 5;
}
if (AutosaveSRAMradioButton2.Checked) if (AutosaveSRAMradioButton2.Checked)
{
return 5 * 60; return 5 * 60;
}
return (int)AutosaveSRAMtextBox.Value; return (int)AutosaveSRAMtextBox.Value;
} }
set { set
{
switch (value) switch (value)
{ {
case 5: case 5:
@ -40,6 +49,7 @@ namespace BizHawk.Client.EmuHawk
AutosaveSRAMtextBox.Enabled = true; AutosaveSRAMtextBox.Enabled = true;
break; break;
} }
AutosaveSRAMtextBox.Value = value; AutosaveSRAMtextBox.Value = value;
} }
} }
@ -98,23 +108,33 @@ namespace BizHawk.Client.EmuHawk
_config.AutosaveSaveRAM = AutosaveSRAMCheckbox.Checked; _config.AutosaveSaveRAM = AutosaveSRAMCheckbox.Checked;
_config.FlushSaveRamFrames = AutosaveSaveRAMSeconds * 60; _config.FlushSaveRamFrames = AutosaveSaveRAMSeconds * 60;
if (_mainForm.AutoFlushSaveRamIn > _config.FlushSaveRamFrames) if (_mainForm.AutoFlushSaveRamIn > _config.FlushSaveRamFrames)
{
_mainForm.AutoFlushSaveRamIn = _config.FlushSaveRamFrames; _mainForm.AutoFlushSaveRamIn = _config.FlushSaveRamFrames;
}
_config.SkipLagFrame = FrameAdvSkipLagCheckbox.Checked; _config.SkipLagFrame = FrameAdvSkipLagCheckbox.Checked;
_config.RunLuaDuringTurbo = LuaDuringTurboCheckbox.Checked; _config.RunLuaDuringTurbo = LuaDuringTurboCheckbox.Checked;
_config.MoviesOnDisk = cbMoviesOnDisk.Checked; _config.MoviesOnDisk = cbMoviesOnDisk.Checked;
_config.MoviesInAwe = cbMoviesInAWE.Checked; _config.MoviesInAwe = cbMoviesInAWE.Checked;
var prevLuaEngine = _config.LuaEngine; var prevLuaEngine = _config.LuaEngine;
if (LuaInterfaceRadio.Checked) _config.LuaEngine = ELuaEngine.LuaPlusLuaInterface; if (LuaInterfaceRadio.Checked)
else if (NLuaRadio.Checked) _config.LuaEngine = ELuaEngine.NLuaPlusKopiLua; {
_config.LuaEngine = ELuaEngine.LuaPlusLuaInterface;
}
else if (NLuaRadio.Checked)
{
_config.LuaEngine = ELuaEngine.NLuaPlusKopiLua;
}
Close();
DialogResult = DialogResult.OK;
_mainForm.AddOnScreenMessage("Custom configurations saved."); _mainForm.AddOnScreenMessage("Custom configurations saved.");
if (prevLuaEngine != _config.LuaEngine) if (prevLuaEngine != _config.LuaEngine)
{ {
_mainForm.AddOnScreenMessage("Restart emulator for Lua change to take effect"); _mainForm.AddOnScreenMessage("Restart emulator for Lua change to take effect");
} }
Close();
DialogResult = DialogResult.OK;
} }
private void CancelBtn_Click(object sender, EventArgs e) private void CancelBtn_Click(object sender, EventArgs e)