quickNes settings - pass dependencies in
This commit is contained in:
parent
e84fd17784
commit
861f238cc1
|
@ -1579,17 +1579,17 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (Emulator is NES nes)
|
||||
{
|
||||
using var form = new NESGraphicsConfig(this, nes.GetSettings());
|
||||
using var form = new NESGraphicsConfig(this, nes.GetSettings().Clone());
|
||||
form.ShowDialog(this);
|
||||
}
|
||||
else if (Emulator is SubNESHawk sub)
|
||||
{
|
||||
using var form = new NESGraphicsConfig(this, sub.GetSettings());
|
||||
using var form = new NESGraphicsConfig(this, sub.GetSettings().Clone());
|
||||
form.ShowDialog(this);
|
||||
}
|
||||
else if (Emulator is QuickNES)
|
||||
else if (Emulator is QuickNES quickNes)
|
||||
{
|
||||
using var form = new QuickNesConfig();
|
||||
using var form = new QuickNesConfig(this, quickNes.GetSettings().Clone());
|
||||
form.ShowDialog(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,16 +10,20 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class QuickNesConfig : Form
|
||||
{
|
||||
private QuickNES.QuickNESSettings _settings;
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly QuickNES.QuickNESSettings _settings;
|
||||
|
||||
public QuickNesConfig()
|
||||
public QuickNesConfig(
|
||||
MainForm mainForm,
|
||||
QuickNES.QuickNESSettings settings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
_settings = settings;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void QuickNesConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
_settings = ((QuickNES)Global.Emulator).GetSettings();
|
||||
propertyGrid1.SelectedObject = _settings;
|
||||
SetPaletteImage();
|
||||
}
|
||||
|
@ -97,7 +101,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void ButtonOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
GlobalWin.MainForm.PutCoreSettings(_settings);
|
||||
_mainForm.PutCoreSettings(_settings);
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue