Remove IOpenAdvanced parsing from places unrelated to recents menu

This commit is contained in:
YoshiRulz 2024-08-08 15:24:53 +10:00
parent 19bf70a9c9
commit 12310befff
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 3 additions and 3 deletions

View File

@ -140,7 +140,7 @@ namespace BizHawk.Client.Common
suppressOSD: false);
public bool OpenRom(string path)
=> _mainForm.LoadRom(path, new LoadRomArgs { OpenAdvanced = OpenAdvancedSerializer.ParseWithLegacy(path) });
=> _mainForm.LoadRom(path, new LoadRomArgs { OpenAdvanced = new OpenAdvanced_OpenRom { Path = path } });
public void Pause() => _mainForm.PauseEmulator();

View File

@ -629,7 +629,7 @@ namespace BizHawk.Client.EmuHawk
if (_argParser.cmdRom != null)
{
// Commandline should always override auto-load
var ioa = OpenAdvancedSerializer.ParseWithLegacy(_argParser.cmdRom);
OpenAdvanced_OpenRom ioa = new() { Path = _argParser.cmdRom };
if (ioa is OpenAdvanced_OpenRom oaor) ioa = new OpenAdvanced_OpenRom { Path = oaor.Path.MakeAbsolute() }; // fixes #3224; should this be done for all the IOpenAdvanced types? --yoshi
_ = LoadRom(ioa.SimplePath, new LoadRomArgs { OpenAdvanced = ioa });
if (Game.IsNullInstance())

View File

@ -142,7 +142,7 @@ namespace BizHawk.Client.EmuHawk
Marshal.Copy(name, 0, buffer, Math.Min(name.Length, 256));
};
_resetEmulator = () => _mainForm.RebootCore();
_loadROM = path => _ = _mainForm.LoadRom(path, new() { OpenAdvanced = OpenAdvancedSerializer.ParseWithLegacy(path) });
_loadROM = path => _ = _mainForm.LoadRom(path, new() { OpenAdvanced = new OpenAdvanced_OpenRom { Path = path } });
RA.InstallSharedFunctionsExt(_isActive, _unpause, _pause, _rebuildMenu, _estimateTitle, _resetEmulator, _loadROM);