From 2adb3deac7db988c5069b3a996f6c7e74715f94a Mon Sep 17 00:00:00 2001 From: zeromus Date: Mon, 17 Aug 2015 23:49:24 -0500 Subject: [PATCH] combine throttle OSD messages into a unified representation --- BizHawk.Client.EmuHawk/MainForm.Events.cs | 14 ++++++++++++-- BizHawk.Client.EmuHawk/MainForm.Hotkey.cs | 2 +- BizHawk.Client.EmuHawk/MainForm.cs | 12 ++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index 380cdb1bb1..c64aa2e684 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -975,7 +975,7 @@ namespace BizHawk.Client.EmuHawk } } - LimitFrameRateMessage(); + ThrottleMessage(); } private void AudioThrottleMenuItem_Click(object sender, EventArgs e) @@ -992,6 +992,8 @@ namespace BizHawk.Client.EmuHawk PresentationPanel.Resized = true; } } + + ThrottleMessage(); } private void VsyncThrottleMenuItem_Click(object sender, EventArgs e) @@ -1009,7 +1011,13 @@ namespace BizHawk.Client.EmuHawk } } - VsyncMessage(); + if (!Global.Config.VSync) + { + Global.Config.VSync = true; + VsyncMessage(); + } + + ThrottleMessage(); } private void VsyncEnabledMenuItem_Click(object sender, EventArgs e) @@ -1019,6 +1027,8 @@ namespace BizHawk.Client.EmuHawk { PresentationPanel.Resized = true; } + + VsyncMessage(); } private void MinimizeSkippingMenuItem_Click(object sender, EventArgs e) diff --git a/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs b/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs index 0a9baaca7d..6c0c1853d0 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs @@ -18,7 +18,7 @@ namespace BizHawk.Client.EmuHawk break; case "Toggle Throttle": _unthrottled ^= true; - GlobalWin.OSD.AddMessage("Unthrottled: " + _unthrottled); + ThrottleMessage(); break; case "Soft Reset": SoftReset(); diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 48f01cf917..9320bc2a14 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -1079,6 +1079,18 @@ namespace BizHawk.Client.EmuHawk } } + void ThrottleMessage() + { + string ttype = ":(none)"; + if(Global.Config.SoundThrottle) { ttype = ":Sound"; } + if(Global.Config.VSyncThrottle) { ttype = String.Format(":Vsync{0}",Global.Config.VSync?"[ena]":"[dis]"); } + if(Global.Config.ClockThrottle) { ttype = ":Clock"; } + string xtype = _unthrottled ? "Unthrottled" : "Throttled"; + string msg = string.Format("{0}{1} ",xtype,ttype); + + GlobalWin.OSD.AddMessage(msg); + } + public void FrameSkipMessage() { GlobalWin.OSD.AddMessage("Frameskipping set to " + Global.Config.FrameSkip);