tastudio: GlobalWin.MainForm alias

almost 100 cases of usage is worth it

make "recent rom not found" window topmost
This commit is contained in:
feos 2016-08-29 19:38:36 +03:00
parent 812221cfdf
commit 05feca4e4e
6 changed files with 75 additions and 69 deletions

View File

@ -221,7 +221,8 @@ namespace BizHawk.Client.EmuHawk.ToolExtensions
} }
else else
{ {
var result = MessageBox.Show("Could not open " + path + "\nRemove from list?", "File not found", MessageBoxButtons.YesNo, MessageBoxIcon.Error); // ensure topmost, not to have to minimize everything to see and use our modal window, if it somehow got covered
var result = MessageBox.Show(new Form(){TopMost = true},"Could not open " + path + "\nRemove from list?", "File not found", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
if (result == DialogResult.Yes) if (result == DialogResult.Yes)
{ {
if (encodedPath != null) if (encodedPath != null)

View File

@ -79,14 +79,14 @@ namespace BizHawk.Client.EmuHawk
public bool Rewind() public bool Rewind()
{ {
// copypasted from TasView_MouseWheel(), just without notch logic // copypasted from TasView_MouseWheel(), just without notch logic
if (GlobalWin.MainForm.IsSeeking) if (Mainform.IsSeeking)
{ {
GlobalWin.MainForm.PauseOnFrame--; Mainform.PauseOnFrame--;
// that's a weird condition here, but for whatever reason it works best // that's a weird condition here, but for whatever reason it works best
if (Emulator.Frame >= GlobalWin.MainForm.PauseOnFrame) if (Emulator.Frame >= Mainform.PauseOnFrame)
{ {
GlobalWin.MainForm.PauseEmulator(); Mainform.PauseEmulator();
GlobalWin.MainForm.PauseOnFrame = null; Mainform.PauseOnFrame = null;
StopSeeking(); StopSeeking();
GoToPreviousFrame(); GoToPreviousFrame();
} }

View File

@ -62,9 +62,9 @@ namespace BizHawk.Client.EmuHawk
{ {
if (_autoRestorePaused == null) if (_autoRestorePaused == null)
{ {
_autoRestorePaused = GlobalWin.MainForm.EmulatorPaused; _autoRestorePaused = Mainform.EmulatorPaused;
if (GlobalWin.MainForm.IsSeeking) // If seeking, do not shorten seek. if (Mainform.IsSeeking) // If seeking, do not shorten seek.
_autoRestoreFrame = GlobalWin.MainForm.PauseOnFrame; _autoRestoreFrame = Mainform.PauseOnFrame;
} }
GoToLastEmulatedFrameIfNecessary(CurrentTasMovie.LastValidFrame); GoToLastEmulatedFrameIfNecessary(CurrentTasMovie.LastValidFrame);
@ -77,10 +77,10 @@ namespace BizHawk.Client.EmuHawk
return; return;
_seekStartFrame = Emulator.Frame; _seekStartFrame = Emulator.Frame;
GlobalWin.MainForm.PauseOnFrame = frame.Value; Mainform.PauseOnFrame = frame.Value;
int? diff = GlobalWin.MainForm.PauseOnFrame - _seekStartFrame; int? diff = Mainform.PauseOnFrame - _seekStartFrame;
GlobalWin.MainForm.UnpauseEmulator(); Mainform.UnpauseEmulator();
if (!_seekBackgroundWorker.IsBusy && diff.Value > TasView.VisibleRows) if (!_seekBackgroundWorker.IsBusy && diff.Value > TasView.VisibleRows)
_seekBackgroundWorker.RunWorkerAsync(); _seekBackgroundWorker.RunWorkerAsync();
@ -151,7 +151,7 @@ namespace BizHawk.Client.EmuHawk
if (columnName == CursorColumnName) if (columnName == CursorColumnName)
{ {
if (index == Emulator.Frame && index == GlobalWin.MainForm.PauseOnFrame) if (index == Emulator.Frame && index == Mainform.PauseOnFrame)
{ {
bitmap = TasView.HorizontalOrientation ? bitmap = TasView.HorizontalOrientation ?
ts_v_arrow_green_blue : ts_v_arrow_green_blue :
@ -224,11 +224,11 @@ namespace BizHawk.Client.EmuHawk
{ {
TasMovieRecord record = CurrentTasMovie[index]; TasMovieRecord record = CurrentTasMovie[index];
if (GlobalWin.MainForm.IsSeeking && GlobalWin.MainForm.PauseOnFrame == index) if (Mainform.IsSeeking && Mainform.PauseOnFrame == index)
{ {
color = CurrentFrame_InputLog; color = CurrentFrame_InputLog;
} }
else if (!GlobalWin.MainForm.IsSeeking && Emulator.Frame == index) else if (!Mainform.IsSeeking && Emulator.Frame == index)
{ {
color = CurrentFrame_InputLog; color = CurrentFrame_InputLog;
} }
@ -401,17 +401,17 @@ namespace BizHawk.Client.EmuHawk
if (e.Button == MouseButtons.Middle) if (e.Button == MouseButtons.Middle)
{ {
if (GlobalWin.MainForm.EmulatorPaused) if (Mainform.EmulatorPaused)
{ {
TasMovieRecord record = CurrentTasMovie[LastPositionFrame]; TasMovieRecord record = CurrentTasMovie[LastPositionFrame];
if (!record.Lagged.HasValue && LastPositionFrame > Global.Emulator.Frame) if (!record.Lagged.HasValue && LastPositionFrame > Global.Emulator.Frame)
StartSeeking(LastPositionFrame); StartSeeking(LastPositionFrame);
else else
GlobalWin.MainForm.UnpauseEmulator(); Mainform.UnpauseEmulator();
} }
else else
{ {
GlobalWin.MainForm.PauseEmulator(); Mainform.PauseEmulator();
} }
return; return;
} }
@ -466,11 +466,11 @@ namespace BizHawk.Client.EmuHawk
} }
else // User changed input else // User changed input
{ {
bool wasPaused = GlobalWin.MainForm.EmulatorPaused; bool wasPaused = Mainform.EmulatorPaused;
if (Emulator.Frame > frame || CurrentTasMovie.LastValidFrame > frame) if (Emulator.Frame > frame || CurrentTasMovie.LastValidFrame > frame)
{ {
if (wasPaused && !GlobalWin.MainForm.IsSeeking && !CurrentTasMovie.LastPositionStable) if (wasPaused && !Mainform.IsSeeking && !CurrentTasMovie.LastPositionStable)
{ {
LastPositionFrame = Emulator.Frame; LastPositionFrame = Emulator.Frame;
CurrentTasMovie.LastPositionStable = true; // until new frame is emulated CurrentTasMovie.LastPositionStable = true; // until new frame is emulated
@ -550,7 +550,7 @@ namespace BizHawk.Client.EmuHawk
// taseditor behavior // taseditor behavior
if (!wasPaused) if (!wasPaused)
GlobalWin.MainForm.UnpauseEmulator(); Mainform.UnpauseEmulator();
} }
} }
else if (e.Button == System.Windows.Forms.MouseButtons.Right) else if (e.Button == System.Windows.Forms.MouseButtons.Right)
@ -670,15 +670,15 @@ namespace BizHawk.Client.EmuHawk
if (notch > 1) if (notch > 1)
notch *= 2; notch *= 2;
// warning: tastudio rewind hotket/button logic is copypasted from here! // warning: tastudio rewind hotkey/button logic is copypasted from here!
if (GlobalWin.MainForm.IsSeeking && !GlobalWin.MainForm.EmulatorPaused) if (Mainform.IsSeeking && !Mainform.EmulatorPaused)
{ {
GlobalWin.MainForm.PauseOnFrame -= notch; Mainform.PauseOnFrame -= notch;
// that's a weird condition here, but for whatever reason it works best // that's a weird condition here, but for whatever reason it works best
if (notch > 0 && Global.Emulator.Frame >= GlobalWin.MainForm.PauseOnFrame) if (notch > 0 && Global.Emulator.Frame >= Mainform.PauseOnFrame)
{ {
GlobalWin.MainForm.PauseEmulator(); Mainform.PauseEmulator();
GlobalWin.MainForm.PauseOnFrame = null; Mainform.PauseOnFrame = null;
StopSeeking(); StopSeeking();
GoToFrame(Emulator.Frame - notch); GoToFrame(Emulator.Frame - notch);
} }

View File

@ -41,7 +41,7 @@ namespace BizHawk.Client.EmuHawk
private void NewTasMenuItem_Click(object sender, EventArgs e) private void NewTasMenuItem_Click(object sender, EventArgs e)
{ {
if (GlobalWin.MainForm.GameIsClosing) if (Mainform.GameIsClosing)
{ {
Close(); Close();
} }
@ -387,7 +387,7 @@ namespace BizHawk.Client.EmuHawk
// TODO: if highlighting 2 rows and pasting 3, only paste 2 of them // TODO: if highlighting 2 rows and pasting 3, only paste 2 of them
// FCEUX Taseditor does't do this, but I think it is the expected behavior in editor programs // FCEUX Taseditor does't do this, but I think it is the expected behavior in editor programs
var wasPaused = GlobalWin.MainForm.EmulatorPaused; var wasPaused = Mainform.EmulatorPaused;
if (_tasClipboard.Any()) if (_tasClipboard.Any())
{ {
@ -404,7 +404,7 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
GlobalWin.MainForm.UnpauseEmulator(); Mainform.UnpauseEmulator();
} }
} }
else else
@ -416,7 +416,7 @@ namespace BizHawk.Client.EmuHawk
private void PasteInsertMenuItem_Click(object sender, EventArgs e) private void PasteInsertMenuItem_Click(object sender, EventArgs e)
{ {
var wasPaused = GlobalWin.MainForm.EmulatorPaused; var wasPaused = Mainform.EmulatorPaused;
if (_tasClipboard.Any()) if (_tasClipboard.Any())
{ {
@ -433,7 +433,7 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
GlobalWin.MainForm.UnpauseEmulator(); Mainform.UnpauseEmulator();
} }
} }
else else
@ -447,7 +447,7 @@ namespace BizHawk.Client.EmuHawk
{ {
if (TasView.AnyRowsSelected) if (TasView.AnyRowsSelected)
{ {
var wasPaused = GlobalWin.MainForm.EmulatorPaused; var wasPaused = Mainform.EmulatorPaused;
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame; var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
var rollBackFrame = TasView.FirstSelectedIndex.Value; var rollBackFrame = TasView.FirstSelectedIndex.Value;
@ -480,7 +480,7 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
GlobalWin.MainForm.UnpauseEmulator(); Mainform.UnpauseEmulator();
} }
} }
else else
@ -494,7 +494,7 @@ namespace BizHawk.Client.EmuHawk
{ {
if (TasView.AnyRowsSelected) if (TasView.AnyRowsSelected)
{ {
bool wasPaused = GlobalWin.MainForm.EmulatorPaused; bool wasPaused = Mainform.EmulatorPaused;
bool needsToRollback = !(TasView.FirstSelectedIndex > Emulator.Frame); bool needsToRollback = !(TasView.FirstSelectedIndex > Emulator.Frame);
int rollBackFrame = TasView.FirstSelectedIndex.Value; int rollBackFrame = TasView.FirstSelectedIndex.Value;
@ -514,7 +514,7 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
GlobalWin.MainForm.UnpauseEmulator(); Mainform.UnpauseEmulator();
} }
} }
else else
@ -528,7 +528,7 @@ namespace BizHawk.Client.EmuHawk
{ {
if (TasView.AnyRowsSelected) if (TasView.AnyRowsSelected)
{ {
var wasPaused = GlobalWin.MainForm.EmulatorPaused; var wasPaused = Mainform.EmulatorPaused;
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame; var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
var rollBackFrame = TasView.FirstSelectedIndex.Value; var rollBackFrame = TasView.FirstSelectedIndex.Value;
if (rollBackFrame >= CurrentTasMovie.InputLogLength) if (rollBackFrame >= CurrentTasMovie.InputLogLength)
@ -549,7 +549,7 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
GlobalWin.MainForm.UnpauseEmulator(); Mainform.UnpauseEmulator();
} }
} }
else else
@ -563,7 +563,7 @@ namespace BizHawk.Client.EmuHawk
{ {
if (TasView.AnyRowsSelected) if (TasView.AnyRowsSelected)
{ {
var wasPaused = GlobalWin.MainForm.EmulatorPaused; var wasPaused = Mainform.EmulatorPaused;
var framesToInsert = TasView.SelectedRows.ToList(); var framesToInsert = TasView.SelectedRows.ToList();
var insertionFrame = Math.Min(TasView.LastSelectedIndex.Value + 1, CurrentTasMovie.InputLogLength); var insertionFrame = Math.Min(TasView.LastSelectedIndex.Value + 1, CurrentTasMovie.InputLogLength);
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame; var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
@ -583,7 +583,7 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
GlobalWin.MainForm.UnpauseEmulator(); Mainform.UnpauseEmulator();
} }
} }
else else
@ -595,7 +595,7 @@ namespace BizHawk.Client.EmuHawk
private void InsertFrameMenuItem_Click(object sender, EventArgs e) private void InsertFrameMenuItem_Click(object sender, EventArgs e)
{ {
var wasPaused = GlobalWin.MainForm.EmulatorPaused; var wasPaused = Mainform.EmulatorPaused;
var insertionFrame = TasView.AnyRowsSelected ? TasView.FirstSelectedIndex.Value : 0; var insertionFrame = TasView.AnyRowsSelected ? TasView.FirstSelectedIndex.Value : 0;
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame; var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
@ -610,7 +610,7 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
GlobalWin.MainForm.UnpauseEmulator(); Mainform.UnpauseEmulator();
} }
} }
else else
@ -621,7 +621,7 @@ namespace BizHawk.Client.EmuHawk
private void InsertNumFramesMenuItem_Click(object sender, EventArgs e) private void InsertNumFramesMenuItem_Click(object sender, EventArgs e)
{ {
bool wasPaused = GlobalWin.MainForm.EmulatorPaused; bool wasPaused = Mainform.EmulatorPaused;
int insertionFrame = TasView.AnyRowsSelected ? TasView.FirstSelectedIndex.Value : 0; int insertionFrame = TasView.AnyRowsSelected ? TasView.FirstSelectedIndex.Value : 0;
bool needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame; bool needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
@ -641,7 +641,7 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
GlobalWin.MainForm.UnpauseEmulator(); Mainform.UnpauseEmulator();
} }
} }
else else
@ -720,7 +720,7 @@ namespace BizHawk.Client.EmuHawk
int goToFrame = CurrentTasMovie.TasStateManager.LastEmulatedFrame; int goToFrame = CurrentTasMovie.TasStateManager.LastEmulatedFrame;
do do
{ {
GlobalWin.MainForm.FrameAdvance(); Mainform.FrameAdvance();
if (CurrentTasMovie.TasStateManager.HasState(Emulator.Frame)) if (CurrentTasMovie.TasStateManager.HasState(Emulator.Frame))
{ {
@ -936,7 +936,7 @@ namespace BizHawk.Client.EmuHawk
{ {
new MovieHeaderEditor(CurrentTasMovie) new MovieHeaderEditor(CurrentTasMovie)
{ {
Owner = GlobalWin.MainForm, Owner = Mainform,
Location = this.ChildPointToScreen(TasView) Location = this.ChildPointToScreen(TasView)
}.Show(); }.Show();
UpdateChangesIndicator(); UpdateChangesIndicator();
@ -946,7 +946,7 @@ namespace BizHawk.Client.EmuHawk
{ {
new StateHistorySettingsForm(CurrentTasMovie.TasStateManager.Settings) new StateHistorySettingsForm(CurrentTasMovie.TasStateManager.Settings)
{ {
Owner = GlobalWin.MainForm, Owner = Mainform,
Location = this.ChildPointToScreen(TasView), Location = this.ChildPointToScreen(TasView),
Statable = this.StatableEmulator Statable = this.StatableEmulator
}.ShowDialog(); }.ShowDialog();
@ -1231,13 +1231,13 @@ namespace BizHawk.Client.EmuHawk
StartFromNowSeparator.Visible =StartNewProjectFromNowMenuItem.Visible || StartANewProjectFromSaveRamMenuItem.Visible; StartFromNowSeparator.Visible =StartNewProjectFromNowMenuItem.Visible || StartANewProjectFromSaveRamMenuItem.Visible;
RemoveMarkersContextMenuItem.Enabled = CurrentTasMovie.Markers.Any(m => TasView.SelectedRows.Contains(m.Frame)); // Disable the option to remove markers if no markers are selected (FCEUX does this). RemoveMarkersContextMenuItem.Enabled = CurrentTasMovie.Markers.Any(m => TasView.SelectedRows.Contains(m.Frame)); // Disable the option to remove markers if no markers are selected (FCEUX does this).
CancelSeekContextMenuItem.Enabled = GlobalWin.MainForm.PauseOnFrame.HasValue; CancelSeekContextMenuItem.Enabled = Mainform.PauseOnFrame.HasValue;
BranchContextMenuItem.Visible = TasView.CurrentCell.RowIndex == Emulator.Frame; BranchContextMenuItem.Visible = TasView.CurrentCell.RowIndex == Emulator.Frame;
} }
private void CancelSeekContextMenuItem_Click(object sender, EventArgs e) private void CancelSeekContextMenuItem_Click(object sender, EventArgs e)
{ {
GlobalWin.MainForm.PauseOnFrame = null; Mainform.PauseOnFrame = null;
RefreshTasView(); RefreshTasView();
} }
@ -1255,7 +1255,7 @@ namespace BizHawk.Client.EmuHawk
TasMovie newProject = CurrentTasMovie.ConvertToSavestateAnchoredMovie( TasMovie newProject = CurrentTasMovie.ConvertToSavestateAnchoredMovie(
index, (byte[])StatableEmulator.SaveStateBinary().Clone()); index, (byte[])StatableEmulator.SaveStateBinary().Clone());
GlobalWin.MainForm.PauseEmulator(); Mainform.PauseEmulator();
LoadFile(new FileInfo(newProject.Filename), true); LoadFile(new FileInfo(newProject.Filename), true);
} }
} }
@ -1270,7 +1270,7 @@ namespace BizHawk.Client.EmuHawk
TasMovie newProject = CurrentTasMovie.ConvertToSaveRamAnchoredMovie( TasMovie newProject = CurrentTasMovie.ConvertToSaveRamAnchoredMovie(
SaveRamEmulator.CloneSaveRam()); SaveRamEmulator.CloneSaveRam());
GlobalWin.MainForm.PauseEmulator(); Mainform.PauseEmulator();
LoadFile(new FileInfo(newProject.Filename), true); LoadFile(new FileInfo(newProject.Filename), true);
} }
} }

View File

@ -43,10 +43,10 @@ namespace BizHawk.Client.EmuHawk
{ {
if (frame == Emulator.Frame + 1) // We are at the end of the movie and advancing one frame, therefore we are recording, simply emulate a frame if (frame == Emulator.Frame + 1) // We are at the end of the movie and advancing one frame, therefore we are recording, simply emulate a frame
{ {
bool wasPaused = GlobalWin.MainForm.EmulatorPaused; bool wasPaused = Mainform.EmulatorPaused;
GlobalWin.MainForm.FrameAdvance(); Mainform.FrameAdvance();
if (!wasPaused) if (!wasPaused)
GlobalWin.MainForm.UnpauseEmulator(); Mainform.UnpauseEmulator();
} }
else else
{ {

View File

@ -110,10 +110,15 @@ namespace BizHawk.Client.EmuHawk
get { return Global.MovieSession.Movie as TasMovie; } get { return Global.MovieSession.Movie as TasMovie; }
} }
public MainForm Mainform
{
get { return GlobalWin.MainForm; }
}
/// <summary> /// <summary>
/// Separates "restore last position" logic from seeking caused by navigation. /// Separates "restore last position" logic from seeking caused by navigation.
/// TASEditor never kills LastPositionFrame, and it only pauses on it, /// TASEditor never kills LastPositionFrame, and it only pauses on it,
/// if it hasn't been greenzoned beforehand and middle mouse button was pressed /// if it hasn't been greenzoned beforehand and middle mouse button was pressed.
/// </summary> /// </summary>
public int LastPositionFrame { get; set; } public int LastPositionFrame { get; set; }
@ -250,7 +255,7 @@ namespace BizHawk.Client.EmuHawk
} }
int diff = Global.Emulator.Frame - _seekStartFrame.Value; int diff = Global.Emulator.Frame - _seekStartFrame.Value;
int unit = GlobalWin.MainForm.PauseOnFrame.Value - _seekStartFrame.Value; int unit = Mainform.PauseOnFrame.Value - _seekStartFrame.Value;
double progress = 0; double progress = 0;
if (diff != 0 && unit != 0) if (diff != 0 && unit != 0)
@ -509,16 +514,16 @@ namespace BizHawk.Client.EmuHawk
private void EngageTastudio() private void EngageTastudio()
{ {
GlobalWin.MainForm.PauseOnFrame = null; Mainform.PauseOnFrame = null;
GlobalWin.OSD.AddMessage("TAStudio engaged"); GlobalWin.OSD.AddMessage("TAStudio engaged");
SetTasMovieCallbacks(); SetTasMovieCallbacks();
SetTextProperty(); SetTextProperty();
GlobalWin.MainForm.PauseEmulator(); Mainform.PauseEmulator();
GlobalWin.MainForm.RelinquishControl(this); Mainform.RelinquishControl(this);
_originalEndAction = Global.Config.MovieEndAction; _originalEndAction = Global.Config.MovieEndAction;
GlobalWin.MainForm.ClearRewindData(); Mainform.ClearRewindData();
Global.Config.MovieEndAction = MovieEndAction.Record; Global.Config.MovieEndAction = MovieEndAction.Record;
GlobalWin.MainForm.SetMainformMovieInfo(); Mainform.SetMainformMovieInfo();
Global.MovieSession.ReadOnly = true; Global.MovieSession.ReadOnly = true;
} }
@ -652,7 +657,7 @@ namespace BizHawk.Client.EmuHawk
if (movie == null) if (movie == null)
movie = CurrentTasMovie; movie = CurrentTasMovie;
SetTasMovieCallbacks(movie as TasMovie); SetTasMovieCallbacks(movie as TasMovie);
bool result = GlobalWin.MainForm.StartNewMovie(movie, record); bool result = Mainform.StartNewMovie(movie, record);
TastudioPlayMode(); TastudioPlayMode();
_initializing = false; _initializing = false;
@ -704,17 +709,17 @@ namespace BizHawk.Client.EmuHawk
private void TastudioStopMovie() private void TastudioStopMovie()
{ {
Global.MovieSession.StopMovie(false); Global.MovieSession.StopMovie(false);
GlobalWin.MainForm.SetMainformMovieInfo(); Mainform.SetMainformMovieInfo();
} }
private void DisengageTastudio() private void DisengageTastudio()
{ {
GlobalWin.MainForm.PauseOnFrame = null; Mainform.PauseOnFrame = null;
GlobalWin.OSD.AddMessage("TAStudio disengaged"); GlobalWin.OSD.AddMessage("TAStudio disengaged");
Global.MovieSession.Movie = MovieService.DefaultInstance; Global.MovieSession.Movie = MovieService.DefaultInstance;
GlobalWin.MainForm.TakeBackControl(); Mainform.TakeBackControl();
Global.Config.MovieEndAction = _originalEndAction; Global.Config.MovieEndAction = _originalEndAction;
GlobalWin.MainForm.SetMainformMovieInfo(); Mainform.SetMainformMovieInfo();
// Do not keep TAStudio's disk save states. // Do not keep TAStudio's disk save states.
//if (Directory.Exists(statesPath)) Directory.Delete(statesPath, true); //if (Directory.Exists(statesPath)) Directory.Delete(statesPath, true);
//TODO - do we need to dispose something here instead? //TODO - do we need to dispose something here instead?
@ -801,7 +806,7 @@ namespace BizHawk.Client.EmuHawk
if (_autoRestorePaused.HasValue && !_autoRestorePaused.Value) if (_autoRestorePaused.HasValue && !_autoRestorePaused.Value)
{ {
// this happens when we're holding the left button while unpaused - view scrolls down, new input gets drawn, seek pauses // this happens when we're holding the left button while unpaused - view scrolls down, new input gets drawn, seek pauses
GlobalWin.MainForm.UnpauseEmulator(); Mainform.UnpauseEmulator();
} }
_autoRestorePaused = null; _autoRestorePaused = null;
} }
@ -824,7 +829,7 @@ namespace BizHawk.Client.EmuHawk
// frame == Emualtor.Frame when frame == 0 // frame == Emualtor.Frame when frame == 0
if (frame > Emulator.Frame) if (frame > Emulator.Frame)
{ {
if (GlobalWin.MainForm.EmulatorPaused || GlobalWin.MainForm.IsSeeking) // make seek frame keep up with emulation on fast scrolls if (Mainform.EmulatorPaused || Mainform.IsSeeking) // make seek frame keep up with emulation on fast scrolls
{ {
StartSeeking(frame); StartSeeking(frame);
} }
@ -866,7 +871,7 @@ namespace BizHawk.Client.EmuHawk
public void TogglePause() public void TogglePause()
{ {
GlobalWin.MainForm.TogglePause(); Mainform.TogglePause();
} }
private void SetSplicer() private void SetSplicer()