2011-08-09 23:42:30 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2013-10-25 00:57:23 +00:00
|
|
|
|
using BizHawk.Client.Common;
|
|
|
|
|
|
2013-11-03 03:54:37 +00:00
|
|
|
|
namespace BizHawk.Client.EmuHawk
|
2011-08-09 23:42:30 +00:00
|
|
|
|
{
|
|
|
|
|
public partial class AutofireConfig : Form
|
|
|
|
|
{
|
|
|
|
|
public AutofireConfig()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void AutofireConfig_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (Global.Config.AutofireOn < OnNumeric.Minimum)
|
2013-11-28 01:33:38 +00:00
|
|
|
|
{
|
2011-08-09 23:42:30 +00:00
|
|
|
|
OnNumeric.Value = OnNumeric.Minimum;
|
2013-11-28 01:33:38 +00:00
|
|
|
|
}
|
2011-08-09 23:42:30 +00:00
|
|
|
|
else if (Global.Config.AutofireOn > OnNumeric.Maximum)
|
2013-11-28 01:33:38 +00:00
|
|
|
|
{
|
2011-08-09 23:42:30 +00:00
|
|
|
|
OnNumeric.Value = OnNumeric.Maximum;
|
2013-11-28 01:33:38 +00:00
|
|
|
|
}
|
2011-08-09 23:42:30 +00:00
|
|
|
|
else
|
2013-11-28 01:33:38 +00:00
|
|
|
|
{
|
2011-08-09 23:42:30 +00:00
|
|
|
|
OnNumeric.Value = Global.Config.AutofireOn;
|
2013-11-28 01:33:38 +00:00
|
|
|
|
}
|
2011-08-09 23:42:30 +00:00
|
|
|
|
|
|
|
|
|
if (Global.Config.AutofireOff < OffNumeric.Minimum)
|
2013-11-28 01:33:38 +00:00
|
|
|
|
{
|
2011-08-09 23:42:30 +00:00
|
|
|
|
OffNumeric.Value = OffNumeric.Minimum;
|
2013-11-28 01:33:38 +00:00
|
|
|
|
}
|
2011-08-09 23:42:30 +00:00
|
|
|
|
else if (Global.Config.AutofireOff > OffNumeric.Maximum)
|
2013-11-28 01:33:38 +00:00
|
|
|
|
{
|
2011-08-09 23:42:30 +00:00
|
|
|
|
OffNumeric.Value = OffNumeric.Maximum;
|
2013-11-28 01:33:38 +00:00
|
|
|
|
}
|
2011-08-09 23:42:30 +00:00
|
|
|
|
else
|
2013-11-28 01:33:38 +00:00
|
|
|
|
{
|
2011-08-09 23:42:30 +00:00
|
|
|
|
OffNumeric.Value = Global.Config.AutofireOff;
|
2013-11-28 01:33:38 +00:00
|
|
|
|
}
|
2011-08-29 22:25:40 +00:00
|
|
|
|
|
2013-11-28 01:33:38 +00:00
|
|
|
|
LagFrameCheck.Checked = Global.Config.AutofireLagFrames;
|
2011-08-09 23:42:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Ok_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2013-10-27 16:26:37 +00:00
|
|
|
|
Global.AutoFireController.On = Global.Config.AutofireOn = (int)OnNumeric.Value;
|
|
|
|
|
Global.AutoFireController.Off = Global.Config.AutofireOff = (int)OffNumeric.Value;
|
2011-08-29 22:25:40 +00:00
|
|
|
|
Global.Config.AutofireLagFrames = LagFrameCheck.Checked;
|
2013-11-03 16:47:21 +00:00
|
|
|
|
Global.AutofireStickyXORAdapter.SetOnOffPatternFromConfig();
|
2012-09-26 01:28:48 +00:00
|
|
|
|
|
2013-11-03 16:07:58 +00:00
|
|
|
|
GlobalWin.OSD.AddMessage("Autofire settings saved");
|
2013-11-28 01:33:38 +00:00
|
|
|
|
Close();
|
2011-08-09 23:42:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Cancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2013-11-03 16:07:58 +00:00
|
|
|
|
GlobalWin.OSD.AddMessage("Autofire config aborted");
|
2013-11-28 01:33:38 +00:00
|
|
|
|
Close();
|
2011-08-09 23:42:30 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|