Skip to content

Commit eb2f7d5

Browse files
committed
refactor of some pause code
1 parent a63b5df commit eb2f7d5

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/BizHawk.Client.EmuHawk/MainForm.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,14 +1082,21 @@ private set
10821082
{
10831083
_didMenuPause = false; // overwritten where relevant
10841084
if (_emulatorPaused == value) return;
1085-
if (_emulatorPaused && !value) // Unpausing
1086-
{
1087-
InitializeFpsData();
1088-
}
1089-
1090-
if (value != _emulatorPaused) Tools.OnPauseToggle(value);
10911085
_emulatorPaused = value;
1086+
1087+
OnPauseToggle(value);
1088+
}
1089+
}
1090+
1091+
private void OnPauseToggle(bool newPauseState)
1092+
{
1093+
if (!newPauseState) // Unpausing
1094+
{
1095+
InitializeFpsData();
10921096
}
1097+
1098+
Tools.OnPauseToggle(newPauseState);
1099+
SetPauseStatusBarIcon();
10931100
}
10941101

10951102
public bool BlockFrameAdvance { get; set; }
@@ -1342,13 +1349,11 @@ public bool RebootCore()
13421349
public void PauseEmulator()
13431350
{
13441351
EmulatorPaused = true;
1345-
SetPauseStatusBarIcon();
13461352
}
13471353

13481354
public void UnpauseEmulator()
13491355
{
13501356
EmulatorPaused = false;
1351-
SetPauseStatusBarIcon();
13521357
}
13531358

13541359
public void TogglePause()

0 commit comments

Comments
 (0)