File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/BizHawk.Client.EmuHawk/tools/Lua/Libraries Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -403,6 +403,19 @@ public LuaTable GetBranches()
403
403
indexFrom : 0 ) ;
404
404
}
405
405
406
+ [ LuaMethodExample ( """
407
+ tastudio.setbranchtext("New label", tastudio.get_branch_index_by_id(branch_id));
408
+ """ ) ]
409
+ [ LuaMethod (
410
+ name : "get_branch_index_by_id" ,
411
+ description : "Finds the branch with the given UUID (0-indexed). Returns -1 if not found." ) ]
412
+ public int GetBranchIndexByID ( string id )
413
+ {
414
+ if ( ! Guid . TryParseExact ( id , format : "D" , out var parsed ) ) return - 1 ;
415
+ return Tastudio . CurrentTasMovie . Branches . Index ( )
416
+ . FirstOrNull ( tuple => tuple . Item . Uuid == parsed ) ? . Index ?? - 1 ;
417
+ }
418
+
406
419
[ LuaMethodExample ( "local nltasget = tastudio.getbranchinput( \" 97021544-2454-4483-824f-47f75e7fcb6a\" , 500 );" ) ]
407
420
[ LuaMethod ( "getbranchinput" , "Gets the controller state of the given frame with the given branch identifier" ) ]
408
421
public LuaTable GetBranchInput ( string branchId , int frame )
You can’t perform that action at this time.
0 commit comments