Skip to content

Commit a073e6b

Browse files
committed
Add branchID parameter to tastudio.getmarker and rewrite docs
1 parent b914bd1 commit a073e6b

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
@@ -446,12 +446,16 @@ public void LoadBranch(int index)
446446
}
447447

448448
[LuaMethodExample("local sttasget = tastudio.getmarker( 500 );")]
449-
[LuaMethod("getmarker", "returns the marker text at the given frame, or nil if there is no marker for the given frame")]
450-
public string/*?*/ GetMarker(int frame)
449+
[LuaMethod(
450+
name: "getmarker",
451+
description: "Returns the label of the marker on the given frame."
452+
+ " If that frame doesn't have a marker (or TAStudio isn't running), returns nil."
453+
+ " If branchID is specified, searches the markers in that branch instead.")]
454+
public string/*?*/ GetMarker(int frame, string/*?*/ branchID = null)
451455
{
452456
if (Engaged())
453457
{
454-
var marker = Tastudio.CurrentTasMovie.Markers.Get(frame);
458+
var marker = MarkerListForBranch(branchID)?.Get(frame);
455459
if (marker != null)
456460
{
457461
return marker.Message;

0 commit comments

Comments
 (0)