Lua - implement savestate.registersave()
This commit is contained in:
parent
83fe222ba9
commit
0330e1f742
|
@ -22,6 +22,22 @@ namespace BizHawk.MultiClient
|
|||
private int CurrentMemoryDomain = 0; //Main memory by default
|
||||
public bool FrameAdvanceRequested;
|
||||
Lua currThread;
|
||||
LuaFunction savestate_registersavefunc;
|
||||
|
||||
public void SavestateRegisterSave()
|
||||
{
|
||||
if (savestate_registersavefunc != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
savestate_registersavefunc.Call();
|
||||
}
|
||||
catch
|
||||
{
|
||||
Global.RenderPanel.AddMessage("error running function attached by lua function savestate.registersave");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public LuaImplementation(LuaConsole passed)
|
||||
{
|
||||
|
@ -285,6 +301,7 @@ namespace BizHawk.MultiClient
|
|||
"loadslot",
|
||||
"save",
|
||||
"load",
|
||||
"registersave",
|
||||
};
|
||||
|
||||
public static string[] MovieFunctions = new string[] {
|
||||
|
@ -297,7 +314,7 @@ namespace BizHawk.MultiClient
|
|||
"getreadonly",
|
||||
"setreadonly",
|
||||
//"rerecordcounting",
|
||||
"getinput",
|
||||
"getinput",
|
||||
};
|
||||
|
||||
public static string[] InputFunctions = new string[] {
|
||||
|
@ -1073,6 +1090,11 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
}
|
||||
|
||||
public void savestate_registersave(LuaFunction luaf)
|
||||
{
|
||||
savestate_registersavefunc = luaf;
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
//Movie library
|
||||
//----------------------------------------------------
|
||||
|
|
|
@ -1892,6 +1892,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void SaveStateFile(StreamWriter writer, string name, bool fromLua)
|
||||
{
|
||||
LuaConsole1.LuaImp.SavestateRegisterSave();
|
||||
Global.Emulator.SaveStateText(writer);
|
||||
HandleMovieSaveState(writer);
|
||||
if (Global.Config.SaveScreenshotWithStates)
|
||||
|
|
Loading…
Reference in New Issue