lua/tastudio - implement tastudio.islag() and tastudio.hasstate()

This commit is contained in:
adelikat 2014-09-22 21:58:45 +00:00
parent 5ae547d89f
commit 7a1fe8d51d
1 changed files with 34 additions and 0 deletions

View File

@ -91,5 +91,39 @@ namespace BizHawk.Client.EmuHawk
}
}
}
[LuaMethodAttributes(
"islag",
"Returns whether or not the given frame was a lag frame, null if unknown"
)]
public bool? IsLag(int frame)
{
if (Engaged())
{
if (frame < Tastudio.CurrentMovie.InputLogLength)
{
return Tastudio.CurrentMovie[frame].Lagged;
}
}
return null;
}
[LuaMethodAttributes(
"hasstate",
"Returns whether or not the given frame has a savestate associated with it"
)]
public bool HasState(int frame)
{
if (Engaged())
{
if (frame < Tastudio.CurrentMovie.InputLogLength)
{
return Tastudio.CurrentMovie[frame].HasState;
}
}
return false;
}
}
}