TAStudio - some progress on dynamically displaying columns, and some fixups in movie code in general

This commit is contained in:
adelikat 2014-07-06 22:13:12 +00:00
parent a02888344b
commit 46d6279f1b
4 changed files with 37 additions and 19 deletions

View File

@ -2,6 +2,7 @@
using System.Text;
using BizHawk.Emulation.Common;
using System.Collections.Generic;
namespace BizHawk.Client.Common
{
@ -87,6 +88,20 @@ namespace BizHawk.Client.Common
return sb.ToString();
}
public Dictionary<string, string> Map()
{
var dict = new Dictionary<string, string>();
foreach (var group in _source.Type.ControlsOrdered.Where(c => c.Any()))
{
foreach (var button in group)
{
dict.Add(button, Mnemonics[button].ToString()); // TODO: floats should be a float lookup that returns a string, floats by convention should always be more than one character to distinguish from boolean input
}
}
return dict;
}
private string CreateLogEntry(bool createEmpty = false)
{
var sb = new StringBuilder();

View File

@ -12,15 +12,15 @@ namespace BizHawk.Client.Common
public Bk2Movie(string filename)
: this()
{
Subtitles = new SubtitleList();
Comments = new List<string>();
Rerecords = 0;
Filename = filename;
}
public Bk2Movie()
{
Subtitles = new SubtitleList();
Comments = new List<string>();
Filename = string.Empty;
IsCountingRerecords = true;
_mode = Moviemode.Inactive;

View File

@ -46,18 +46,5 @@ namespace BizHawk.Client.Common
{
// TODO
}
public Dictionary<string, string> ColumnNames
{
get
{
// TODO
return new Dictionary<string, string>
{
{ "A", "A" },
{ "B", "B" }
};
}
}
}
}

View File

@ -29,6 +29,22 @@ namespace BizHawk.Client.EmuHawk
private bool _startMarkerDrag;
private bool _startFrameDrag;
private Dictionary<string, string> _map = null;
private Dictionary<string, string> ColumnNames
{
get
{
if (_map == null)
{
var lg = new Bk2LogEntryGenerator(string.Empty);
lg.SetSource(Global.MovieSession.MovieControllerAdapter);
_map = lg.Map();
}
return _map;
}
}
#region API
public TAStudio()
@ -195,7 +211,7 @@ namespace BizHawk.Client.EmuHawk
EngageTasStudio();
}
//SetUpColumns();
SetUpColumns();
//LoadConfigSettings();
}
@ -223,10 +239,10 @@ namespace BizHawk.Client.EmuHawk
private void SetUpColumns()
{
TasView.Columns.Clear();
AddColumn(MarkerColumnName, String.Empty, 18);
AddColumn(MarkerColumnName, string.Empty, 18);
AddColumn(FrameColumnName, "Frame#", 68);
foreach (var kvp in _tas.ColumnNames)
foreach (var kvp in ColumnNames)
{
AddColumn(kvp.Key, kvp.Value, 20);
}