Create and use helper for changing core pref. when importing movies
This commit is contained in:
parent
3249ae202e
commit
3b8f08b1b0
|
@ -25,6 +25,17 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
protected IDialogParent _dialogParent;
|
protected IDialogParent _dialogParent;
|
||||||
|
|
||||||
|
protected void MaybeSetCorePreference(string sysID, string coreName, string fileExt)
|
||||||
|
{
|
||||||
|
if (Config.PreferredCores[sysID] != coreName
|
||||||
|
&& _dialogParent.ModalMessageBox2(
|
||||||
|
$"{fileExt} movies will have a better chance of syncing using the {coreName} core. Change your core preference for {sysID} roms to {coreName} now?",
|
||||||
|
icon: EMsgBoxIcon.Question))
|
||||||
|
{
|
||||||
|
Config.PreferredCores[sysID] = coreName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public ImportResult Import(
|
public ImportResult Import(
|
||||||
IDialogParent dialogParent,
|
IDialogParent dialogParent,
|
||||||
IMovieSession session,
|
IMovieSession session,
|
||||||
|
|
|
@ -259,7 +259,7 @@ namespace BizHawk.Client.Common.movie.import
|
||||||
|
|
||||||
Result.Movie.HeaderEntries[HeaderKeys.Platform] = platform;
|
Result.Movie.HeaderEntries[HeaderKeys.Platform] = platform;
|
||||||
Result.Movie.SyncSettingsJson = ConfigService.SaveWithType(ss);
|
Result.Movie.SyncSettingsJson = ConfigService.SaveWithType(ss);
|
||||||
Config.PreferredCores["SNES"] = CoreNames.Bsnes; // TODO: convert to snes9x if it is the user's preference
|
MaybeSetCorePreference(sysID: "SNES", CoreNames.Bsnes, fileExt: ".lsmv");
|
||||||
}
|
}
|
||||||
|
|
||||||
private IController EmptyLmsvFrame()
|
private IController EmptyLmsvFrame()
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace BizHawk.Client.Common.movie.import
|
||||||
|
|
||||||
protected override void RunImport()
|
protected override void RunImport()
|
||||||
{
|
{
|
||||||
Result.Movie.HeaderEntries[HeaderKeys.Core] = CoreNames.Bsnes;
|
Result.Movie.HeaderEntries[HeaderKeys.Core] = CoreNames.Bsnes; //TODO set to Snes9x instead? or give the user the choice?
|
||||||
|
|
||||||
using var fs = SourceFile.Open(FileMode.Open, FileAccess.Read);
|
using var fs = SourceFile.Open(FileMode.Open, FileAccess.Read);
|
||||||
using var r = new BinaryReader(fs);
|
using var r = new BinaryReader(fs);
|
||||||
|
@ -311,7 +311,7 @@ namespace BizHawk.Client.Common.movie.import
|
||||||
Result.Movie.AppendFrame(controllers);
|
Result.Movie.AppendFrame(controllers);
|
||||||
|
|
||||||
Result.Movie.SyncSettingsJson = ConfigService.SaveWithType(ss);
|
Result.Movie.SyncSettingsJson = ConfigService.SaveWithType(ss);
|
||||||
Config.PreferredCores["SNES"] = CoreNames.Bsnes; // TODO: convert to snes9x if it is the user's preference
|
MaybeSetCorePreference(sysID: "SNES", CoreNames.Bsnes, fileExt: ".smv");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue