Intellivision config - pass dependencies in
This commit is contained in:
parent
394641f2af
commit
a58411efa0
|
@ -28,6 +28,7 @@ using BizHawk.Emulation.Cores.Computers.Commodore64;
|
||||||
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
|
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
|
||||||
using BizHawk.Emulation.Cores.Computers.SinclairSpectrum;
|
using BizHawk.Emulation.Cores.Computers.SinclairSpectrum;
|
||||||
using BizHawk.Emulation.Cores.Computers.AmstradCPC;
|
using BizHawk.Emulation.Cores.Computers.AmstradCPC;
|
||||||
|
using BizHawk.Emulation.Cores.Intellivision;
|
||||||
|
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
|
@ -2521,9 +2522,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void IntVControllerSettingsMenuItem_Click(object sender, EventArgs e)
|
private void IntVControllerSettingsMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
using var form = new IntvControllerSettings();
|
if (Emulator is Intellivision intv)
|
||||||
|
{
|
||||||
|
using var form = new IntvControllerSettings(this, intv.GetSyncSettings().Clone());
|
||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,26 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
using BizHawk.Client.Common;
|
|
||||||
using BizHawk.Emulation.Cores.Intellivision;
|
using BizHawk.Emulation.Cores.Intellivision;
|
||||||
|
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
public partial class IntvControllerSettings : Form
|
public partial class IntvControllerSettings : Form
|
||||||
{
|
{
|
||||||
private Intellivision.IntvSyncSettings _syncSettings;
|
private readonly MainForm _mainForm;
|
||||||
|
private readonly Intellivision.IntvSyncSettings _syncSettings;
|
||||||
|
|
||||||
public IntvControllerSettings()
|
public IntvControllerSettings(
|
||||||
|
MainForm mainForm,
|
||||||
|
Intellivision.IntvSyncSettings syncSettings)
|
||||||
{
|
{
|
||||||
|
_mainForm = mainForm;
|
||||||
|
_syncSettings = syncSettings;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void IntvControllerSettings_Load(object sender, EventArgs e)
|
private void IntvControllerSettings_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_syncSettings = ((Intellivision)Global.Emulator).GetSyncSettings().Clone();
|
|
||||||
|
|
||||||
var possibleControllers = IntellivisionControllerDeck.ValidControllerTypes.Select(t => t.Key);
|
var possibleControllers = IntellivisionControllerDeck.ValidControllerTypes.Select(t => t.Key);
|
||||||
|
|
||||||
foreach (var val in possibleControllers)
|
foreach (var val in possibleControllers)
|
||||||
|
@ -43,7 +44,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
_syncSettings.Port1 = Port1ComboBox.SelectedItem.ToString();
|
_syncSettings.Port1 = Port1ComboBox.SelectedItem.ToString();
|
||||||
_syncSettings.Port2 = Port2ComboBox.SelectedItem.ToString();
|
_syncSettings.Port2 = Port2ComboBox.SelectedItem.ToString();
|
||||||
|
|
||||||
GlobalWin.MainForm.PutCoreSyncSettings(_syncSettings);
|
_mainForm.PutCoreSyncSettings(_syncSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogResult = DialogResult.OK;
|
DialogResult = DialogResult.OK;
|
||||||
|
@ -52,7 +53,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void CancelBtn_Click(object sender, EventArgs e)
|
private void CancelBtn_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
GlobalWin.OSD.AddMessage("Controller settings aborted");
|
_mainForm.AddOnScreenMessage("Controller settings aborted");
|
||||||
DialogResult = DialogResult.Cancel;
|
DialogResult = DialogResult.Cancel;
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue