Improve UX when movie `Core` header can't be honoured (see #3582)
This commit is contained in:
parent
a21b9e049f
commit
cc59818d6d
|
@ -55,6 +55,9 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public string QueuedCoreName => _queuedMovie?.Core;
|
public string QueuedCoreName => _queuedMovie?.Core;
|
||||||
|
|
||||||
|
public string/*?*/ QueuedSysID
|
||||||
|
=> _queuedMovie?.SystemID;
|
||||||
|
|
||||||
public IDictionary<string, object> UserBag { get; set; } = new Dictionary<string, object>();
|
public IDictionary<string, object> UserBag { get; set; } = new Dictionary<string, object>();
|
||||||
|
|
||||||
public IController MovieIn { get; set; }
|
public IController MovieIn { get; set; }
|
||||||
|
|
|
@ -23,6 +23,9 @@ namespace BizHawk.Client.Common
|
||||||
/// <value>The Core header of the queued movie iff one is queued, else <see langword="null"/></value>
|
/// <value>The Core header of the queued movie iff one is queued, else <see langword="null"/></value>
|
||||||
string QueuedCoreName { get; }
|
string QueuedCoreName { get; }
|
||||||
|
|
||||||
|
/// <value>The <see cref="IBasicMovieInfo.SystemID"/> header of the queued movie iff one is queued, else <see langword="null"/></value>
|
||||||
|
string/*?*/ QueuedSysID { get; }
|
||||||
|
|
||||||
IDictionary<string, object> UserBag { get; set; }
|
IDictionary<string, object> UserBag { get; set; }
|
||||||
|
|
||||||
IMovieController MovieController { get; }
|
IMovieController MovieController { get; }
|
||||||
|
|
|
@ -3821,11 +3821,35 @@ namespace BizHawk.Client.EmuHawk
|
||||||
//path = ioa_openrom.Path;
|
//path = ioa_openrom.Path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var forcedCoreName = MovieSession.QueuedCoreName ?? string.Empty;
|
||||||
|
if (!CoreInventory.Instance.SystemsFlat.Any(core => core.Name == forcedCoreName))
|
||||||
|
{
|
||||||
|
const string FMT_STR_NO_SUCH_CORE = "This movie is for the \"{0}\" core,"
|
||||||
|
+ " but that's not a valid {1} core. (Was the movie made in this version of EmuHawk?)"
|
||||||
|
+ "\nContinue with your preferred core instead?";
|
||||||
|
#if false //TODO let the user pick?
|
||||||
|
var availCores = CoreInventory.Instance.AllCores.GetValueOrDefault(MovieSession.QueuedSysID, [ ]);
|
||||||
|
#endif
|
||||||
|
if (!this.ModalMessageBox2(
|
||||||
|
caption: "No such core",
|
||||||
|
icon: EMsgBoxIcon.Error,
|
||||||
|
text: string.Format(
|
||||||
|
FMT_STR_NO_SUCH_CORE,
|
||||||
|
forcedCoreName,
|
||||||
|
EmulatorExtensions.SystemIDToDisplayName(MovieSession.QueuedSysID))))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
forcedCoreName = null;
|
||||||
|
}
|
||||||
|
|
||||||
DisplayManager.ActivateOpenGLContext(); // required in case the core wants to create a shared OpenGL context
|
DisplayManager.ActivateOpenGLContext(); // required in case the core wants to create a shared OpenGL context
|
||||||
|
|
||||||
bool result = string.IsNullOrEmpty(MovieSession.QueuedCoreName)
|
var result = loader.LoadRom(
|
||||||
? loader.LoadRom(path, nextComm, ioaRetro?.CorePath)
|
path: path,
|
||||||
: loader.LoadRom(path, nextComm, ioaRetro?.CorePath, forcedCoreName: MovieSession.QueuedCoreName);
|
nextComm,
|
||||||
|
launchLibretroCore: ioaRetro?.CorePath,
|
||||||
|
forcedCoreName: forcedCoreName);
|
||||||
|
|
||||||
// we need to replace the path in the OpenAdvanced with the canonical one the user chose.
|
// we need to replace the path in the OpenAdvanced with the canonical one the user chose.
|
||||||
// It can't be done until loader.LoadRom happens (for CanonicalFullPath)
|
// It can't be done until loader.LoadRom happens (for CanonicalFullPath)
|
||||||
|
|
Loading…
Reference in New Issue