Skip to content

Commit ff04b85

Browse files
committed
Add branchIndex parameter to tastudio.getmarker
1 parent f4d9829 commit ff04b85

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/TAStudioLuaLibrary.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,16 @@ public void LoadBranch(int index)
444444
}
445445

446446
[LuaMethodExample("local sttasget = tastudio.getmarker( 500 );")]
447-
[LuaMethod("getmarker", "returns the marker text at the given frame, or an empty string if there is no marker for the given frame")]
448-
public string GetMarker(int frame)
447+
[LuaMethod(
448+
name: "getmarker",
449+
description: "Returns the label of the marker on the given frame."
450+
+ " If that frame doesn't have a marker (or TAStudio isn't running), returns an empty string."
451+
+ " If branchIndex is specified, searches the markers in that branch instead.")]
452+
public string GetMarker(int frame, int? branchIndex = null)
449453
{
450454
if (Engaged())
451455
{
452-
var marker = Tastudio.CurrentTasMovie.Markers.Get(frame);
456+
var marker = MarkerListForBranch(branchIndex).Get(frame);
453457
if (marker != null)
454458
{
455459
return marker.Message;

0 commit comments

Comments
 (0)