TAStudio - restore copy functionality including generating an input log and putting it on the clipboard

This commit is contained in:
adelikat 2014-07-11 18:17:48 +00:00
parent 2072eac45f
commit 1ef25132a1
1 changed files with 9 additions and 2 deletions

View File

@ -7,6 +7,7 @@ using System.Windows.Forms;
using BizHawk.Client.Common;
using BizHawk.Client.Common.MovieConversionExtensions;
using System.Text;
namespace BizHawk.Client.EmuHawk
{
@ -375,12 +376,18 @@ namespace BizHawk.Client.EmuHawk
{
_tasClipboard.Clear();
var list = TasView.SelectedIndices;
var sb = new StringBuilder();
for (var i = 0; i < list.Count; i++)
{
//Serialize TODO
//_tasClipboard.Add(new TasClipboardEntry(list[i], _tas[i].Buttons));
var input = _tas.GetInputState(i);
_tasClipboard.Add(new TasClipboardEntry(i, input));
var lg = _tas.LogGeneratorInstance();
lg.SetSource(input);
sb.AppendLine(lg.GenerateLogEntry());
}
Clipboard.SetDataObject(sb.ToString());
SetSplicer();
}