Lua - implement tastudio.loadbranch #fixes #1650
This commit is contained in:
parent
74e1f97ebb
commit
4e9b780539
|
@ -428,6 +428,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
return table;
|
||||
}
|
||||
|
||||
[LuaMethodExample("tastudio.loadbranch(0)")]
|
||||
[LuaMethod("loadbranch", "Loads a branch at the given index, if a branch at that index exists.")]
|
||||
public void LoadBranch(int index)
|
||||
{
|
||||
if (Engaged())
|
||||
{
|
||||
Tastudio.LoadBranchByIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Markers
|
||||
|
|
|
@ -191,7 +191,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
};
|
||||
}
|
||||
|
||||
private void LoadBranch(TasBranch branch)
|
||||
public void LoadBranch(TasBranch branch)
|
||||
{
|
||||
if (Tastudio.Settings.OldControlSchemeForBranches && !Tastudio.TasPlaybackBox.RecordingMode)
|
||||
{
|
||||
|
|
|
@ -138,6 +138,15 @@ namespace BizHawk.Client.EmuHawk
|
|||
LastPositionFrame = -1;
|
||||
}
|
||||
|
||||
public void LoadBranchByIndex(int index)
|
||||
{
|
||||
if (index < CurrentTasMovie.BranchCount)
|
||||
{
|
||||
var branch = CurrentTasMovie.Branches[index];
|
||||
BookMarkControl.LoadBranch(branch);
|
||||
}
|
||||
}
|
||||
|
||||
private void AutosaveTimerEventProcessor(object sender, EventArgs e)
|
||||
{
|
||||
if (CurrentTasMovie == null)
|
||||
|
|
Loading…
Reference in New Issue