Factor out some common stuff in rom load/close.
This commit is contained in:
parent
b1554be720
commit
952609eeaa
|
@ -97,12 +97,6 @@ namespace BizHawk.Client.Common
|
||||||
return _redo[slot];
|
return _redo[slot];
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Clear()
|
|
||||||
{
|
|
||||||
ClearRedoList();
|
|
||||||
Update();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SwapBackupSavestate(string path)
|
public void SwapBackupSavestate(string path)
|
||||||
{
|
{
|
||||||
// Takes the .state and .bak files and swaps them
|
// Takes the .state and .bak files and swaps them
|
||||||
|
|
|
@ -3819,14 +3819,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetWindowText();
|
|
||||||
CurrentlyOpenRom = oa_openrom?.Path ?? openAdvancedArgs;
|
CurrentlyOpenRom = oa_openrom?.Path ?? openAdvancedArgs;
|
||||||
CurrentlyOpenRomArgs = args;
|
CurrentlyOpenRomArgs = args;
|
||||||
HandlePlatformMenus();
|
OnRomChanged();
|
||||||
_stateSlots.Clear();
|
|
||||||
UpdateCoreStatusBarButton();
|
|
||||||
UpdateDumpIcon();
|
|
||||||
SetMainformMovieInfo();
|
|
||||||
GlobalWin.DisplayManager.Blank();
|
GlobalWin.DisplayManager.Blank();
|
||||||
|
|
||||||
Global.Rewinder.Initialize();
|
Global.Rewinder.Initialize();
|
||||||
|
@ -3854,26 +3849,17 @@ namespace BizHawk.Client.EmuHawk
|
||||||
ClientApi.OnRomLoaded(Emulator);
|
ClientApi.OnRomLoaded(Emulator);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else if (!(Emulator is NullEmulator))
|
||||||
{
|
{
|
||||||
// This shows up if there's a problem
|
|
||||||
// TODO: put all these in a single method or something
|
|
||||||
|
|
||||||
// The ROM has been loaded by a recursive invocation of the LoadROM method.
|
// The ROM has been loaded by a recursive invocation of the LoadROM method.
|
||||||
if (!(Emulator is NullEmulator))
|
|
||||||
{
|
|
||||||
ClientApi.OnRomLoaded(Emulator);
|
ClientApi.OnRomLoaded(Emulator);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// This shows up if there's a problem
|
||||||
ClientApi.UpdateEmulatorAndVP(Emulator);
|
ClientApi.UpdateEmulatorAndVP(Emulator);
|
||||||
HandlePlatformMenus();
|
OnRomChanged();
|
||||||
_stateSlots.Clear();
|
|
||||||
UpdateStatusSlots();
|
|
||||||
UpdateCoreStatusBarButton();
|
|
||||||
UpdateDumpIcon();
|
|
||||||
SetMainformMovieInfo();
|
|
||||||
SetWindowText();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3886,6 +3872,17 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnRomChanged()
|
||||||
|
{
|
||||||
|
SetWindowText();
|
||||||
|
HandlePlatformMenus();
|
||||||
|
_stateSlots.ClearRedoList();
|
||||||
|
UpdateStatusSlots();
|
||||||
|
UpdateCoreStatusBarButton();
|
||||||
|
UpdateDumpIcon();
|
||||||
|
SetMainformMovieInfo();
|
||||||
|
}
|
||||||
|
|
||||||
private void CommitCoreSettingsToConfig()
|
private void CommitCoreSettingsToConfig()
|
||||||
{
|
{
|
||||||
// save settings object
|
// save settings object
|
||||||
|
@ -3979,17 +3976,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
GlobalWin.Tools.Restart();
|
GlobalWin.Tools.Restart();
|
||||||
ApiManager.Restart(Emulator.ServiceProvider);
|
ApiManager.Restart(Emulator.ServiceProvider);
|
||||||
RewireSound();
|
RewireSound();
|
||||||
Text = $"BizHawk{(VersionInfo.DeveloperBuild ? " (interim) " : "")}";
|
|
||||||
HandlePlatformMenus();
|
|
||||||
_stateSlots.Clear();
|
|
||||||
UpdateDumpIcon();
|
|
||||||
UpdateCoreStatusBarButton();
|
|
||||||
ClearHolds();
|
ClearHolds();
|
||||||
PauseOnFrame = null;
|
|
||||||
ToolFormBase.UpdateCheatRelatedTools(null, null);
|
ToolFormBase.UpdateCheatRelatedTools(null, null);
|
||||||
UpdateStatusSlots();
|
PauseOnFrame = null;
|
||||||
CurrentlyOpenRom = null;
|
CurrentlyOpenRom = null;
|
||||||
CurrentlyOpenRomArgs = null;
|
CurrentlyOpenRomArgs = null;
|
||||||
|
OnRomChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue