setup another a7800 config dialog to pass in dependencies
This commit is contained in:
parent
92768858f7
commit
4d3c423f15
|
@ -2048,8 +2048,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void A7800FilterSettingsToolStripMenuItem_Click(object sender, EventArgs e)
|
private void A7800FilterSettingsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
using var form = new A7800FilterSettings();
|
if (Emulator is A7800Hawk atari7800Hawk)
|
||||||
form.ShowDialog();
|
{
|
||||||
|
using var form = new A7800FilterSettings(this, atari7800Hawk.GetSyncSettings().Clone());
|
||||||
|
form.ShowDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -2365,6 +2365,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Get/Put settings/sync settings methods could become a service we instantiate and use and pass to other forms
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// send core sync settings to emu, setting reboot flag if needed
|
/// send core sync settings to emu, setting reboot flag if needed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
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.Atari.A7800Hawk;
|
using BizHawk.Emulation.Cores.Atari.A7800Hawk;
|
||||||
|
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
|
|
|
@ -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.Atari.A7800Hawk;
|
using BizHawk.Emulation.Cores.Atari.A7800Hawk;
|
||||||
|
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
public partial class A7800FilterSettings : Form
|
public partial class A7800FilterSettings : Form
|
||||||
{
|
{
|
||||||
private A7800Hawk.A7800SyncSettings _syncSettings;
|
private readonly MainForm _mainForm;
|
||||||
|
private readonly A7800Hawk.A7800SyncSettings _syncSettings;
|
||||||
|
|
||||||
public A7800FilterSettings()
|
public A7800FilterSettings(
|
||||||
|
MainForm mainForm,
|
||||||
|
A7800Hawk.A7800SyncSettings syncSettings)
|
||||||
{
|
{
|
||||||
|
_mainForm = mainForm;
|
||||||
|
_syncSettings = syncSettings;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void A7800FilterSettings_Load(object sender, EventArgs e)
|
private void A7800FilterSettings_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_syncSettings = ((A7800Hawk)Global.Emulator).GetSyncSettings().Clone();
|
|
||||||
|
|
||||||
var possibleFilters = A7800Hawk.ValidFilterTypes.Select(t => t.Key);
|
var possibleFilters = A7800Hawk.ValidFilterTypes.Select(t => t.Key);
|
||||||
|
|
||||||
foreach (var val in possibleFilters)
|
foreach (var val in possibleFilters)
|
||||||
|
@ -37,8 +38,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
_syncSettings.Filter = Port1ComboBox.SelectedItem.ToString();
|
_syncSettings.Filter = Port1ComboBox.SelectedItem.ToString();
|
||||||
|
_mainForm.PutCoreSyncSettings(_syncSettings);
|
||||||
GlobalWin.MainForm.PutCoreSyncSettings(_syncSettings);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogResult = DialogResult.OK;
|
DialogResult = DialogResult.OK;
|
||||||
|
@ -47,7 +47,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void CancelBtn_Click(object sender, EventArgs e)
|
private void CancelBtn_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
GlobalWin.OSD.AddMessage("Filter settings aborted");
|
_mainForm.AddOnScreenMessage("Filter settings aborted");
|
||||||
DialogResult = DialogResult.Cancel;
|
DialogResult = DialogResult.Cancel;
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue