From 5a2e8071d6d583c12251ed48ab44170178234493 Mon Sep 17 00:00:00 2001 From: adelikat Date: Tue, 21 Oct 2014 01:31:41 +0000 Subject: [PATCH] Tastudio - break some code into a function in preparation for stuff --- .../tools/TAStudio/TAStudio.ListView.cs | 9 +-------- BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs index 4a6b78af1e..0d02464f50 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs @@ -280,14 +280,7 @@ namespace BizHawk.Client.EmuHawk _supressContextMenu = false; - if (_triggerAutoRestore) - { - GoToLastEmulatedFrameIfNecessary(_triggerAutoRestoreFromFrame.Value); - DoAutoRestore(); - - _triggerAutoRestore = false; - _triggerAutoRestoreFromFrame = null; - } + DoTriggeredAutoRestoreIfNeeded(); } private void TasView_MouseWheel(object sender, MouseEventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 6d67696d6f..c7000f437a 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -461,6 +461,18 @@ namespace BizHawk.Client.EmuHawk return result; } + private void DoTriggeredAutoRestoreIfNeeded() + { + if (_triggerAutoRestore) + { + GoToLastEmulatedFrameIfNecessary(_triggerAutoRestoreFromFrame.Value); + DoAutoRestore(); + + _triggerAutoRestore = false; + _triggerAutoRestoreFromFrame = null; + } + } + #region Dialog Events private void Tastudio_Load(object sender, EventArgs e)