lua - implement movie.InsertFrame(int index, string logEntry), for now, will only work on .bk2 movies (.bkm and .tasproj will crash)

This commit is contained in:
adelikat 2015-08-01 15:46:43 -04:00
parent 0b4dfb0ba0
commit 383a462207
2 changed files with 15 additions and 0 deletions

View File

@ -14,6 +14,19 @@ namespace BizHawk.Client.Common
public override string Name { get { return "movie"; } }
[LuaMethodAttributes(
"insertframe",
"Inserts a log entry string into the specified index of the movie input log"
)]
public void InsertFrame(int index, string logEntry)
{
if (Global.MovieSession.Movie.IsActive)
{
// TODO: don't make this bk2 specific, and don't expose the log as the means to do this!
(Global.MovieSession.Movie as Bk2Movie).Log.Insert(index, logEntry);
}
}
[LuaMethodAttributes(
"filename",
"Returns the file name including path of the currently loaded movie"

View File

@ -42,6 +42,8 @@ namespace BizHawk.Client.Common
}
}
public List<string> Log { get { return _log; } }
public string Name { get; private set; }
public virtual string PreferredExtension { get { return Extension; } }