TAStudio - start new recording on load, and generate columns dynamically based on the core currently loaded. Currently only does 1 player's worth of columns.

This commit is contained in:
adelikat 2013-12-05 19:18:20 +00:00
parent b6eb13a8b2
commit 5384fcfdd2
2 changed files with 31 additions and 1 deletions

View File

@ -88,7 +88,14 @@ namespace BizHawk.Client.Common
{
if (frame < _records.Count)
{
return _records[frame].Input;
if (frame >= 0)
{
return _records[frame].Input;
}
else
{
return String.Empty;
}
}
else
{

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using BizHawk.Client.Common;
@ -13,6 +14,7 @@ namespace BizHawk.Client.EmuHawk
{
private int _defaultWidth;
private int _defaultHeight;
private TasMovie _tas;
#region API
@ -56,6 +58,8 @@ namespace BizHawk.Client.EmuHawk
public void UpdateValues()
{
if (!IsHandleCreated || IsDisposed) return;
TASView.ItemCount = _tas.InputLogLength;
}
public void Restart()
@ -89,7 +93,26 @@ namespace BizHawk.Client.EmuHawk
GlobalWin.OSD.AddMessage("TAStudio engaged");
Global.MovieSession.Movie = new TasMovie();
_tas = Global.MovieSession.Movie as TasMovie;
_tas.StartNewRecording();
LoadConfigSettings();
SetUpColumns();
}
private void SetUpColumns()
{
TASView.Columns.Clear();
ToolHelpers.AddColumn(TASView, "", true, 18);
ToolHelpers.AddColumn(TASView, "Frame#", true, 68);
var mnemonics = MnemonicConstants.BUTTONS[Global.Emulator.Controller.Type.Name].Select(x => x.Value);
foreach (var mnemonic in mnemonics)
{
ToolHelpers.AddColumn(TASView, mnemonic, true, 20);
}
}
private void LoadConfigSettings()