From 4fa037c0b227ca914a4519480282daab36eac371 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 13 Mar 2017 19:11:57 +0900 Subject: [PATCH 1/2] Update framework. --- osu-framework | 2 +- osu.Game/Modes/LegacyReplay.cs | 26 ++++++++------------- osu.Game/Screens/Play/PlayerInputManager.cs | 8 +++---- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/osu-framework b/osu-framework index a50dd75b11..e52af1e5ad 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit a50dd75b114da963c75e6a5314099d99140035b8 +Subproject commit e52af1e5ada07468512e19c86b6dcd5a23fe3707 diff --git a/osu.Game/Modes/LegacyReplay.cs b/osu.Game/Modes/LegacyReplay.cs index 9ab6c587a9..4b77550cbc 100644 --- a/osu.Game/Modes/LegacyReplay.cs +++ b/osu.Game/Modes/LegacyReplay.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.IO; +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Input; using osu.Framework.MathUtils; using osu.Game.Input.Handlers; @@ -95,24 +96,17 @@ namespace osu.Game.Modes public override List GetPendingStates() { + var buttons = new HashSet(); + if (CurrentFrame?.MouseLeft ?? false) + buttons.Add(MouseButton.Left); + if (CurrentFrame?.MouseRight ?? false) + buttons.Add(MouseButton.Right); + return new List { new InputState { - Mouse = new ReplayMouseState( - ToScreenSpace(position ?? Vector2.Zero), - new List - { - new MouseState.ButtonState(MouseButton.Left) - { - State = CurrentFrame?.MouseLeft ?? false - }, - new MouseState.ButtonState(MouseButton.Right) - { - State = CurrentFrame?.MouseRight ?? false - }, - } - ), + Mouse = new ReplayMouseState(ToScreenSpace(position ?? Vector2.Zero), buttons), Keyboard = new ReplayKeyboardState(new List()) } }; @@ -171,10 +165,10 @@ namespace osu.Game.Modes private class ReplayMouseState : MouseState { - public ReplayMouseState(Vector2 position, List list) + public ReplayMouseState(Vector2 position, IEnumerable list) { Position = position; - ButtonStates = list; + list.ForEach(b => PressedButtons.Add(b)); } } diff --git a/osu.Game/Screens/Play/PlayerInputManager.cs b/osu.Game/Screens/Play/PlayerInputManager.cs index a16c1ba9c6..3eab30c50d 100644 --- a/osu.Game/Screens/Play/PlayerInputManager.cs +++ b/osu.Game/Screens/Play/PlayerInputManager.cs @@ -70,14 +70,14 @@ namespace osu.Game.Screens.Play { if (mouseDisabled.Value) { - mouse.ButtonStates.Find(s => s.Button == MouseButton.Left).State = false; - mouse.ButtonStates.Find(s => s.Button == MouseButton.Right).State = false; + mouse.PressedButtons.Remove(MouseButton.Left); + mouse.PressedButtons.Remove(MouseButton.Right); } if (leftViaKeyboard) - mouse.ButtonStates.Find(s => s.Button == MouseButton.Left).State = true; + mouse.PressedButtons.Add(MouseButton.Left); if (rightViaKeyboard) - mouse.ButtonStates.Find(s => s.Button == MouseButton.Right).State = true; + mouse.PressedButtons.Add(MouseButton.Right); } } From 9eaec6945f5f057fbf3d57d8c77646c9faf1e58c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 Mar 2017 12:02:06 +0900 Subject: [PATCH 2/2] Update resources. --- osu-resources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-resources b/osu-resources index 39657fc606..4f9ed4e703 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 39657fc6066ea3a141ac71cabf67ec9ebf24975c +Subproject commit 4f9ed4e703777ede98737c7e2af31efa4694c395