tastudio: use Emulator the same way branch control uses it
this fixes a bug that generated a whole stack of temp fixes over temp fixes, as well as the crash those were trying to prevent
This commit is contained in:
parent
7e6ca99e1a
commit
3548ec00dc
|
@ -16,7 +16,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public partial class MarkerControl : UserControl
|
public partial class MarkerControl : UserControl
|
||||||
{
|
{
|
||||||
public TAStudio Tastudio { get; set; }
|
public TAStudio Tastudio { get; set; }
|
||||||
public IEmulator Emulator { get; set; }
|
|
||||||
public TasMovieMarkerList Markers { get { return Tastudio.CurrentTasMovie.Markers; } }
|
public TasMovieMarkerList Markers { get { return Tastudio.CurrentTasMovie.Markers; } }
|
||||||
|
|
||||||
public MarkerControl()
|
public MarkerControl()
|
||||||
|
@ -52,10 +51,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void MarkerView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
|
private void MarkerView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
|
||||||
{
|
{
|
||||||
var prev = Markers.PreviousOrCurrent(0);
|
var prev = Markers.PreviousOrCurrent(Tastudio.Emulator.Frame);
|
||||||
|
|
||||||
if (this.Emulator!=null) //Temp fix
|
|
||||||
prev = Markers.PreviousOrCurrent(Emulator.Frame);
|
|
||||||
|
|
||||||
if (prev != null && index == Markers.IndexOf(prev))
|
if (prev != null && index == Markers.IndexOf(prev))
|
||||||
{
|
{
|
||||||
|
@ -164,7 +160,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public void AddMarker(bool editText = false, int? frame = null)
|
public void AddMarker(bool editText = false, int? frame = null)
|
||||||
{
|
{
|
||||||
// feos: we specify the selected frame if we call this from TasView, otherwise marker should be added to the emulated frame
|
// feos: we specify the selected frame if we call this from TasView, otherwise marker should be added to the emulated frame
|
||||||
var markerFrame = frame ?? Emulator.Frame;
|
var markerFrame = frame ?? Tastudio.Emulator.Frame;
|
||||||
|
|
||||||
if (editText)
|
if (editText)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1315,7 +1315,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
this.MarkerControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
this.MarkerControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
| System.Windows.Forms.AnchorStyles.Left)
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.MarkerControl.Emulator = null;
|
|
||||||
this.MarkerControl.Location = new System.Drawing.Point(2, 16);
|
this.MarkerControl.Location = new System.Drawing.Point(2, 16);
|
||||||
this.MarkerControl.Name = "MarkerControl";
|
this.MarkerControl.Name = "MarkerControl";
|
||||||
this.MarkerControl.Size = new System.Drawing.Size(194, 193);
|
this.MarkerControl.Size = new System.Drawing.Size(194, 193);
|
||||||
|
|
|
@ -140,7 +140,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
TasPlaybackBox.Tastudio = this;
|
TasPlaybackBox.Tastudio = this;
|
||||||
MarkerControl.Tastudio = this;
|
MarkerControl.Tastudio = this;
|
||||||
BookMarkControl.Tastudio = this;
|
BookMarkControl.Tastudio = this;
|
||||||
MarkerControl.Emulator = this.Emulator;
|
|
||||||
TasView.QueryItemText += TasView_QueryItemText;
|
TasView.QueryItemText += TasView_QueryItemText;
|
||||||
TasView.QueryItemBkColor += TasView_QueryItemBkColor;
|
TasView.QueryItemBkColor += TasView_QueryItemBkColor;
|
||||||
TasView.QueryRowBkColor += TasView_QueryRowBkColor;
|
TasView.QueryRowBkColor += TasView_QueryRowBkColor;
|
||||||
|
|
Loading…
Reference in New Issue