add SetPlayback to tastudio lua library. Can't be 100% sure it works, but it seems to be working OK. it may hang everything up if you seek through a really long redzone.....
This commit is contained in:
parent
a70e6e2fc4
commit
539cdc29f3
|
@ -282,6 +282,11 @@ namespace BizHawk.Client.Common
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int FindIndex(string markerName)
|
||||||
|
{
|
||||||
|
return this.FindIndex(m => m.Message == markerName);
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsMarker(int frame)
|
public bool IsMarker(int frame)
|
||||||
{
|
{
|
||||||
return this.Any(m => m == frame);
|
return this.Any(m => m == frame);
|
||||||
|
|
|
@ -155,6 +155,30 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[LuaMethodAttributes(
|
||||||
|
"setplayback",
|
||||||
|
"Seeks the given frame (a number) or marker (a string)"
|
||||||
|
)]
|
||||||
|
public void SetPlayback(object frame)
|
||||||
|
{
|
||||||
|
if (Engaged())
|
||||||
|
{
|
||||||
|
int f;
|
||||||
|
if (frame is double) f = (int)(double)frame;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//r marker = Tastudio.CurrentTasMovie.Markers.Get(frame);
|
||||||
|
f = Tastudio.CurrentTasMovie.Markers.FindIndex((string)frame);
|
||||||
|
if (f == -1) return;
|
||||||
|
f = Tastudio.CurrentTasMovie.Markers[f].Frame;
|
||||||
|
}
|
||||||
|
if (f < Tastudio.CurrentTasMovie.InputLogLength && f>=0)
|
||||||
|
{
|
||||||
|
Tastudio.GoToFrame(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[LuaMethodAttributes(
|
[LuaMethodAttributes(
|
||||||
"onqueryitembg",
|
"onqueryitembg",
|
||||||
"called during the background draw event of the tastudio listview"
|
"called during the background draw event of the tastudio listview"
|
||||||
|
|
Loading…
Reference in New Issue