privatereadonlyList<PendingChanges>_changeList=newList<PendingChanges>();//TODO: Initialize it to empty list on a script reload, and have each script have it's own list
[LuaMethod("setlag", "Sets the lag information for the given frame, if the frame does not exist in the lag log, it will be added. If the value is null, the lag information for that frame will be removed")]
[LuaMethodExample("if ( tastudio.hasstate( 500 ) ) then\r\n\tconsole.log( \"Returns whether or not the given frame has a savestate associated with it\" );\r\nend;")]
[LuaMethod("setbranchtext", "adds the given message to the existing branch, or to the branch that will be created next if branch index is not specified")]
[LuaMethodExample("tastudio.onqueryitembg( function( currentindex, itemname )\r\n\tconsole.log( \"called during the background draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)\" );\r\nend );")]
[LuaMethod("onqueryitembg", "called during the background draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)")]
publicvoidOnQueryItemBg(LuaFunctionluaf)
{
if(Engaged())
{
Tastudio.QueryItemBgColorCallback=(index,name)=>
{
varresult=luaf.Call(index,name);
if(result!=null)
{
varcolor=ToColor(result[0]);
returncolor;
}
returnnull;
};
}
}
[LuaMethodExample("tastudio.onqueryitemtext( function( currentindex, itemname )\r\n\tconsole.log( \"called during the text draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)\" );\r\nend );")]
[LuaMethod("onqueryitemtext", "called during the text draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)")]
publicvoidOnQueryItemText(LuaFunctionluaf)
{
if(Engaged())
{
Tastudio.QueryItemTextCallback=(index,name)=>
{
varresult=luaf.Call(index,name);
returnresult?[0]?.ToString();
};
}
}
[LuaMethodExample("tastudio.onqueryitemicon( function( currentindex, itemname )\r\n\tconsole.log( \"called during the icon draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)\" );\r\nend );")]
[LuaMethod("onqueryitemicon", "called during the icon draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)")]
publicvoidOnQueryItemIcon(LuaFunctionluaf)
{
if(Engaged())
{
Tastudio.QueryItemIconCallback=(index,name)=>
{
varresult=luaf.Call(index,name);
if(result?[0]!=null)
{
stringpath=result[0].ToString();
Iconicon=newIcon(path);
returnicon.ToBitmap();
}
returnnull;
};
}
}
[LuaMethodExample("tastudio.ongreenzoneinvalidated( function( currentindex, itemname )\r\n\tconsole.log( \"called whenever the greenzone is invalidated and returns the first frame that was invalidated\" );\r\nend );")]
[LuaMethod("ongreenzoneinvalidated", "called whenever the greenzone is invalidated and returns the first frame that was invalidated")]
publicvoidOnGreenzoneInvalidated(LuaFunctionluaf)
{
if(Engaged())
{
Tastudio.GreenzoneInvalidatedCallback=index=>
{
luaf.Call(index);
};
}
}
[LuaMethodExample("tastudio.ongreenzoneinvalidated( function( currentindex, itemname )\r\n\tconsole.log( \"called whenever the greenzone is invalidated and returns the first frame that was invalidated\" );\r\nend );")]
[LuaMethod("onbranchload", "called whenever a branch is loaded. luaf must be a function that takes the integer branch index as a parameter")]
publicvoidOnBranchLoad(LuaFunctionluaf)
{
if(Engaged())
{
Tastudio.BranchLoadedCallback=index=>
{
luaf.Call(index);
};
}
}
[LuaMethodExample("")]
[LuaMethod("onbranchsave", "called whenever a branch is created or updated. luaf must be a function that takes the integer branch index as a parameter")]
publicvoidOnBranchSave(LuaFunctionluaf)
{
if(Engaged())
{
Tastudio.BranchSavedCallback=index=>
{
luaf.Call(index);
};
}
}
[LuaMethodExample("")]
[LuaMethod("onbranchremove", "called whenever a branch is removed. luaf must be a function that takes the integer branch index as a parameter")]