Don't expose `MainForm.Emulator` via `IMainFormForConfig`
This commit is contained in:
parent
2cd6510784
commit
c1524d8de9
|
@ -7,9 +7,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public interface IMainFormForConfig : IDialogParent
|
||||
{
|
||||
/// <remarks>only referenced from <see cref="GenericCoreConfig"/></remarks>
|
||||
IEmulator Emulator { get; }
|
||||
|
||||
/// <exception cref="InvalidOperationException">loaded emulator is not instance of <typeparamref name="T"/></exception>
|
||||
SettingsAdapter GetSettingsAdapterForLoadedCore<T>()
|
||||
where T : IEmulator;
|
||||
|
|
|
@ -1844,7 +1844,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
private DialogResult OpenGenericCoreConfig(string title)
|
||||
=> GenericCoreConfig.DoDialog(this, title, isMovieActive: MovieSession.Movie.IsActive());
|
||||
=> GenericCoreConfig.DoDialog(Emulator, this, title, isMovieActive: MovieSession.Movie.IsActive());
|
||||
|
||||
private void GenericCoreSettingsMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
|
|
@ -73,9 +73,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
Close();
|
||||
}
|
||||
|
||||
public static DialogResult DoDialog(IMainFormForConfig owner, string title, bool isMovieActive)
|
||||
public static DialogResult DoDialog(IEmulator emulator, IMainFormForConfig owner, string title, bool isMovieActive)
|
||||
{
|
||||
if (owner.Emulator is Emulation.Cores.Waterbox.NymaCore core)
|
||||
if (emulator is Emulation.Cores.Waterbox.NymaCore core)
|
||||
{
|
||||
var desc = new Emulation.Cores.Waterbox.NymaTypeDescriptorProvider(core.SettingsInfo);
|
||||
try
|
||||
|
@ -91,7 +91,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
TypeDescriptor.RemoveProvider(desc, typeof(Emulation.Cores.Waterbox.NymaCore.NymaSyncSettings));
|
||||
}
|
||||
}
|
||||
else if(owner.Emulator is Emulation.Cores.Arcades.MAME.MAME mame)
|
||||
else if (emulator is Emulation.Cores.Arcades.MAME.MAME mame)
|
||||
{
|
||||
var desc = new Emulation.Cores.Arcades.MAME.MAMETypeDescriptorProvider(mame.CurrentDriverSettings);
|
||||
try
|
||||
|
|
Loading…
Reference in New Issue