From 1d964ceaeb6b50aff00af1492fd154e9f166565e Mon Sep 17 00:00:00 2001 From: Dade Lamkins Date: Wed, 14 Oct 2020 23:17:23 -0400 Subject: [PATCH 1/3] Set mouse state update loop to go back to using the polled mouse state instead of using the raw mouse state. --- Blish HUD/GameServices/Input/Mouse/MouseHandler.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Blish HUD/GameServices/Input/Mouse/MouseHandler.cs b/Blish HUD/GameServices/Input/Mouse/MouseHandler.cs index c166ee3d7..3bf590b74 100644 --- a/Blish HUD/GameServices/Input/Mouse/MouseHandler.cs +++ b/Blish HUD/GameServices/Input/Mouse/MouseHandler.cs @@ -109,16 +109,14 @@ public void Update() { var rawMouseState = Mouse.GetState(); - this.State = new MouseState( - (int) (this.PositionRaw.X / GameService.Graphics.UIScaleMultiplier), - (int) (this.PositionRaw.Y / GameService.Graphics.UIScaleMultiplier), + this.State = new MouseState((int) (rawMouseState.X / GameService.Graphics.UIScaleMultiplier), + (int) (rawMouseState.Y / GameService.Graphics.UIScaleMultiplier), _mouseEvent?.WheelDelta ?? 0, rawMouseState.LeftButton, rawMouseState.MiddleButton, rawMouseState.RightButton, rawMouseState.XButton1, - rawMouseState.XButton2 - ); + rawMouseState.XButton2); // Handle mouse moved if (prevMouseState.Position != this.State.Position) { From 013e517cab23a728a33e4af6f8bc076251a3c27b Mon Sep 17 00:00:00 2001 From: Dade Lamkins Date: Wed, 14 Oct 2020 23:19:09 -0400 Subject: [PATCH 2/3] ++patch --- Blish HUD/GameServices/Input/Mouse/MouseHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Blish HUD/GameServices/Input/Mouse/MouseHandler.cs b/Blish HUD/GameServices/Input/Mouse/MouseHandler.cs index 3bf590b74..80fb7eb04 100644 --- a/Blish HUD/GameServices/Input/Mouse/MouseHandler.cs +++ b/Blish HUD/GameServices/Input/Mouse/MouseHandler.cs @@ -111,7 +111,7 @@ public void Update() { this.State = new MouseState((int) (rawMouseState.X / GameService.Graphics.UIScaleMultiplier), (int) (rawMouseState.Y / GameService.Graphics.UIScaleMultiplier), - _mouseEvent?.WheelDelta ?? 0, + _mouseEvent?.WheelDelta ?? 0, rawMouseState.LeftButton, rawMouseState.MiddleButton, rawMouseState.RightButton, From 7bb82c03f7a4cb339e489ff6f5cdf8332a2ea974 Mon Sep 17 00:00:00 2001 From: Dade Lamkins Date: Wed, 14 Oct 2020 23:31:44 -0400 Subject: [PATCH 3/3] Catch errors with audio level detection. --- .../GameServices/GameIntegration/AudioIntegration.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Blish HUD/GameServices/GameIntegration/AudioIntegration.cs b/Blish HUD/GameServices/GameIntegration/AudioIntegration.cs index 580b2ef67..ed444c936 100644 --- a/Blish HUD/GameServices/GameIntegration/AudioIntegration.cs +++ b/Blish HUD/GameServices/GameIntegration/AudioIntegration.cs @@ -76,7 +76,14 @@ public override void Update(GameTime gameTime) { if (_timeSinceCheck > CHECK_INTERVAL) { _timeSinceCheck -= CHECK_INTERVAL; - _audioPeakBuffer.PushValue(_processMeterInformation.GetPeakValue()); + try { + _audioPeakBuffer.PushValue(_processMeterInformation.GetPeakValue()); + } catch (Exception e) { + // Punish audio clock for 10 seconds + _timeSinceCheck = -10000; + + Logger.Debug(e, "Getting meter volume failed."); + } _averageGameVolume = null; }