Fix Load/Save Named State to default to the correct savestate path rather than the most recently used path. Fix so that these functions can not be accessed during Null emulator via hotkey
This commit is contained in:
parent
75b5ec9223
commit
2aeedf074e
|
@ -2021,8 +2021,9 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
private void SaveStateAs()
|
private void SaveStateAs()
|
||||||
{
|
{
|
||||||
|
if (IsNullEmulator()) return;
|
||||||
var sfd = new SaveFileDialog();
|
var sfd = new SaveFileDialog();
|
||||||
string path = PathManager.SaveStatePrefix(Global.Game);
|
string path = PathManager.GetSaveStatePath(Global.Game);
|
||||||
sfd.InitialDirectory = path;
|
sfd.InitialDirectory = path;
|
||||||
sfd.FileName = PathManager.SaveStatePrefix(Global.Game) + "." + "QuickSave0.State";
|
sfd.FileName = PathManager.SaveStatePrefix(Global.Game) + "." + "QuickSave0.State";
|
||||||
var file = new FileInfo(path);
|
var file = new FileInfo(path);
|
||||||
|
@ -2078,8 +2079,9 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
private void LoadStateAs()
|
private void LoadStateAs()
|
||||||
{
|
{
|
||||||
|
if (IsNullEmulator()) return;
|
||||||
var ofd = new OpenFileDialog();
|
var ofd = new OpenFileDialog();
|
||||||
ofd.InitialDirectory = PathManager.SaveStatePrefix(Global.Game);
|
ofd.InitialDirectory = PathManager.GetSaveStatePath(Global.Game);
|
||||||
ofd.Filter = "Save States (*.State)|*.State|All Files|*.*";
|
ofd.Filter = "Save States (*.State)|*.State|All Files|*.*";
|
||||||
ofd.RestoreDirectory = true;
|
ofd.RestoreDirectory = true;
|
||||||
|
|
||||||
|
|
|
@ -310,6 +310,25 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetSaveStatePath(GameInfo game)
|
||||||
|
{
|
||||||
|
switch (game.System)
|
||||||
|
{
|
||||||
|
default: return GetRomsPath(game.System);
|
||||||
|
case "A26": return MakeAbsolutePath(Global.Config.PathAtariSavestates, "A26");
|
||||||
|
case "SMS": return MakeAbsolutePath(Global.Config.PathSMSSavestates, "SMS");
|
||||||
|
case "GG": return MakeAbsolutePath(Global.Config.PathGGSavestates, "GG");
|
||||||
|
case "SG": return MakeAbsolutePath(Global.Config.PathSGSavestates, "SG");
|
||||||
|
case "SGX": return MakeAbsolutePath(Global.Config.PathPCESavestates, "PCE");
|
||||||
|
case "PCE": return MakeAbsolutePath(Global.Config.PathPCESavestates, "PCE");
|
||||||
|
case "PCECD": return MakeAbsolutePath(Global.Config.PathPCESavestates, "PCE");
|
||||||
|
case "GB": return MakeAbsolutePath(Global.Config.PathGBSavestates, "GB");
|
||||||
|
case "GEN": return MakeAbsolutePath(Global.Config.PathGenesisSavestates, "GEN");
|
||||||
|
case "NES": return MakeAbsolutePath(Global.Config.PathNESSavestates, "NES");
|
||||||
|
case "TI83": return MakeAbsolutePath(Global.Config.PathTI83Savestates, "TI83");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static string SaveStatePrefix(GameInfo game)
|
public static string SaveStatePrefix(GameInfo game)
|
||||||
{
|
{
|
||||||
string name = FilesystemSafeName(game);
|
string name = FilesystemSafeName(game);
|
||||||
|
|
Loading…
Reference in New Issue