TAStudio - misc stuff
This commit is contained in:
parent
786b0238ba
commit
537d8c5cac
|
@ -82,47 +82,8 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Specialized Marker that represents the currently emulated frame
|
|
||||||
/// Frame always points to Global.Emulator.Frame, and setting it isn't possible
|
|
||||||
/// </summary>
|
|
||||||
public class CurrentFrameMarker : TasMovieMarker
|
|
||||||
{
|
|
||||||
public CurrentFrameMarker()
|
|
||||||
: base(0)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Frame
|
|
||||||
{
|
|
||||||
get { return Global.Emulator.Frame; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string Message
|
|
||||||
{
|
|
||||||
get { return string.Empty; }
|
|
||||||
set { return; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class TasMovieMarkerList : List<TasMovieMarker>
|
public class TasMovieMarkerList : List<TasMovieMarker>
|
||||||
{
|
{
|
||||||
private readonly CurrentFrameMarker _current;
|
|
||||||
public TasMovieMarkerList()
|
|
||||||
: base()
|
|
||||||
{
|
|
||||||
_current = new CurrentFrameMarker();
|
|
||||||
}
|
|
||||||
|
|
||||||
public CurrentFrameMarker CurrentFrame
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _current;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
|
@ -9,6 +9,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public void UpdateValues()
|
public void UpdateValues()
|
||||||
{
|
{
|
||||||
|
SetUpColumns();
|
||||||
|
|
||||||
if (!IsHandleCreated || IsDisposed)
|
if (!IsHandleCreated || IsDisposed)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -35,7 +37,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public bool AskSave()
|
public bool AskSave()
|
||||||
{
|
{
|
||||||
if (_tas.Changes)
|
if (_tas != null && _tas.Changes)
|
||||||
{
|
{
|
||||||
GlobalWin.Sound.StopSound();
|
GlobalWin.Sound.StopSound();
|
||||||
var result = MessageBox.Show("Save Changes?", "Tastudio", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
|
var result = MessageBox.Show("Save Changes?", "Tastudio", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
|
||||||
|
|
|
@ -16,7 +16,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private const string MarkerColumnName = "MarkerColumn";
|
private const string MarkerColumnName = "MarkerColumn";
|
||||||
private const string FrameColumnName = "FrameColumn";
|
private const string FrameColumnName = "FrameColumn";
|
||||||
|
|
||||||
private readonly TasMovieMarkerList _markers = new TasMovieMarkerList();
|
|
||||||
private readonly List<TasClipboardEntry> _tasClipboard = new List<TasClipboardEntry>();
|
private readonly List<TasClipboardEntry> _tasClipboard = new List<TasClipboardEntry>();
|
||||||
|
|
||||||
private int _defaultWidth;
|
private int _defaultWidth;
|
||||||
|
@ -29,20 +28,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private bool _startMarkerDrag;
|
private bool _startMarkerDrag;
|
||||||
private bool _startFrameDrag;
|
private bool _startFrameDrag;
|
||||||
|
|
||||||
private Dictionary<string, string> _map = null;
|
private Dictionary<string, string> GenerateColumnNames()
|
||||||
private Dictionary<string, string> ColumnNames
|
|
||||||
{
|
{
|
||||||
get
|
var lg = Global.MovieSession.LogGeneratorInstance();
|
||||||
{
|
lg.SetSource(Global.MovieSession.MovieControllerAdapter);
|
||||||
if (_map == null)
|
return (lg as Bk2LogEntryGenerator).Map();
|
||||||
{
|
|
||||||
var lg = new Bk2LogEntryGenerator(string.Empty);
|
|
||||||
lg.SetSource(Global.MovieSession.MovieControllerAdapter);
|
|
||||||
_map = lg.Map();
|
|
||||||
}
|
|
||||||
|
|
||||||
return _map;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TAStudio()
|
public TAStudio()
|
||||||
|
@ -73,7 +63,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private void TasView_QueryItemBkColor(int index, int column, ref Color color)
|
private void TasView_QueryItemBkColor(int index, int column, ref Color color)
|
||||||
{
|
{
|
||||||
var record = _tas[index];
|
var record = _tas[index];
|
||||||
if (_markers.CurrentFrame == index + 1)
|
if (Global.Emulator.Frame == index + 1)
|
||||||
{
|
{
|
||||||
color = Color.LightBlue;
|
color = Color.LightBlue;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +86,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
if (columnName == MarkerColumnName)
|
if (columnName == MarkerColumnName)
|
||||||
{
|
{
|
||||||
text = _markers.CurrentFrame == index + 1 ? ">" : string.Empty;
|
text = Global.Emulator.Frame == index + 1 ? ">" : string.Empty;
|
||||||
}
|
}
|
||||||
else if (columnName == FrameColumnName)
|
else if (columnName == FrameColumnName)
|
||||||
{
|
{
|
||||||
|
@ -233,7 +223,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
AddColumn(MarkerColumnName, string.Empty, 18);
|
AddColumn(MarkerColumnName, string.Empty, 18);
|
||||||
AddColumn(FrameColumnName, "Frame#", 68);
|
AddColumn(FrameColumnName, "Frame#", 68);
|
||||||
|
|
||||||
foreach (var kvp in ColumnNames)
|
foreach (var kvp in GenerateColumnNames())
|
||||||
{
|
{
|
||||||
AddColumn(kvp.Key, kvp.Value, 20 * kvp.Value.Length);
|
AddColumn(kvp.Key, kvp.Value, 20 * kvp.Value.Length);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue