Lua - savestate.registersave/load - pass state name as a string (ex:"quicksave0"). Put event after the save/load not before. Event no longer fires on non-saveslot events
This commit is contained in:
parent
397f289493
commit
c88a6b4b7a
|
@ -25,13 +25,13 @@ namespace BizHawk.MultiClient
|
|||
LuaFunction savestate_registersavefunc;
|
||||
LuaFunction savestate_registerloadfunc;
|
||||
|
||||
public void SavestateRegisterSave()
|
||||
public void SavestateRegisterSave(string name)
|
||||
{
|
||||
if (savestate_registersavefunc != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
savestate_registersavefunc.Call();
|
||||
savestate_registersavefunc.Call(name);
|
||||
}
|
||||
catch (SystemException e)
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
}
|
||||
|
||||
public void SavestateRegisterLoad()
|
||||
public void SavestateRegisterLoad(string name)
|
||||
{
|
||||
if (savestate_registerloadfunc != null)
|
||||
{
|
||||
|
|
|
@ -1888,11 +1888,11 @@ namespace BizHawk.MultiClient
|
|||
|
||||
var writer = new StreamWriter(path);
|
||||
SaveStateFile(writer, name, false);
|
||||
LuaConsole1.LuaImp.SavestateRegisterSave(name);
|
||||
}
|
||||
|
||||
public void SaveStateFile(StreamWriter writer, string name, bool fromLua)
|
||||
{
|
||||
LuaConsole1.LuaImp.SavestateRegisterSave();
|
||||
Global.Emulator.SaveStateText(writer);
|
||||
HandleMovieSaveState(writer);
|
||||
if (Global.Config.SaveScreenshotWithStates)
|
||||
|
@ -1938,7 +1938,6 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void LoadStateFile(string path, string name)
|
||||
{
|
||||
LuaConsole1.LuaImp.SavestateRegisterLoad();
|
||||
if (HandleMovieLoadState(path))
|
||||
{
|
||||
var reader = new StreamReader(path);
|
||||
|
@ -1970,6 +1969,7 @@ namespace BizHawk.MultiClient
|
|||
return;
|
||||
|
||||
LoadStateFile(path, name);
|
||||
LuaConsole1.LuaImp.SavestateRegisterLoad(name);
|
||||
}
|
||||
|
||||
private void LoadStateAs()
|
||||
|
|
Loading…
Reference in New Issue