Move LoadRomArgs to own file

This commit is contained in:
YoshiRulz 2020-06-17 01:03:47 +10:00
parent 8b9debb8b9
commit 03acb1ded7
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
6 changed files with 14 additions and 10 deletions

View File

@ -234,7 +234,7 @@ namespace BizHawk.Client.EmuHawk
public void OnStateSaved(object sender, string stateName) => StateSaved?.Invoke(sender, new StateSavedEventArgs(stateName));
public void OpenRom(string path) => _mainForm.LoadRom(path, new MainForm.LoadRomArgs { OpenAdvanced = OpenAdvancedSerializer.ParseWithLegacy(path) });
public void OpenRom(string path) => _mainForm.LoadRom(path, new LoadRomArgs { OpenAdvanced = OpenAdvancedSerializer.ParseWithLegacy(path) });
public void Pause() => _mainForm.PauseEmulator();

View File

@ -0,0 +1,10 @@
using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
public class LoadRomArgs
{
public bool? Deterministic { get; set; }
public IOpenAdvanced OpenAdvanced { get; set; }
}
}

View File

@ -3556,12 +3556,6 @@ namespace BizHawk.Client.EmuHawk
return platformChooser.PlatformChoice;
}
public class LoadRomArgs
{
public bool? Deterministic { get; set; }
public IOpenAdvanced OpenAdvanced { get; set; }
}
private LoadRomArgs _currentLoadRomArgs;
public bool LoadRom(string path, LoadRomArgs args)

View File

@ -325,7 +325,7 @@ namespace BizHawk.Client.EmuHawk
private void this_StartupNextInstance(object sender, StartupNextInstanceEventArgs e)
{
if (e.CommandLine.Count >= 1)
((MainForm)MainForm).LoadRom(e.CommandLine[0], new MainForm.LoadRomArgs { OpenAdvanced = new OpenAdvanced_OpenRom() });
((MainForm)MainForm).LoadRom(e.CommandLine[0], new LoadRomArgs { OpenAdvanced = new OpenAdvanced_OpenRom() });
}
protected override void OnCreateMainForm()

View File

@ -231,7 +231,7 @@ namespace BizHawk.Client.EmuHawk
public void OpenRom(string path)
{
var ioa = OpenAdvancedSerializer.ParseWithLegacy(path);
MainForm.LoadRom(path, new MainForm.LoadRomArgs { OpenAdvanced = ioa });
MainForm.LoadRom(path, new LoadRomArgs { OpenAdvanced = ioa });
}
[LuaMethodExample("client.opentasstudio( );")]

View File

@ -90,7 +90,7 @@ namespace BizHawk.Client.EmuHawk
DialogResult = DialogResult.OK;
Close();
var lra = new MainForm.LoadRomArgs { OpenAdvanced = new OpenAdvanced_OpenRom { Path = fileInfo.FullName } };
var lra = new LoadRomArgs { OpenAdvanced = new OpenAdvanced_OpenRom { Path = fileInfo.FullName } };
MainForm.LoadRom(fileInfo.FullName, lra);
}
}