mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Submodule osu-framework updated: a50dd75b11...e52af1e5ad
Submodule osu-resources updated: 39657fc606...4f9ed4e703
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Input.Handlers;
|
using osu.Game.Input.Handlers;
|
||||||
@ -95,24 +96,17 @@ namespace osu.Game.Modes
|
|||||||
|
|
||||||
public override List<InputState> GetPendingStates()
|
public override List<InputState> GetPendingStates()
|
||||||
{
|
{
|
||||||
|
var buttons = new HashSet<MouseButton>();
|
||||||
|
if (CurrentFrame?.MouseLeft ?? false)
|
||||||
|
buttons.Add(MouseButton.Left);
|
||||||
|
if (CurrentFrame?.MouseRight ?? false)
|
||||||
|
buttons.Add(MouseButton.Right);
|
||||||
|
|
||||||
return new List<InputState>
|
return new List<InputState>
|
||||||
{
|
{
|
||||||
new InputState
|
new InputState
|
||||||
{
|
{
|
||||||
Mouse = new ReplayMouseState(
|
Mouse = new ReplayMouseState(ToScreenSpace(position ?? Vector2.Zero), buttons),
|
||||||
ToScreenSpace(position ?? Vector2.Zero),
|
|
||||||
new List<MouseState.ButtonState>
|
|
||||||
{
|
|
||||||
new MouseState.ButtonState(MouseButton.Left)
|
|
||||||
{
|
|
||||||
State = CurrentFrame?.MouseLeft ?? false
|
|
||||||
},
|
|
||||||
new MouseState.ButtonState(MouseButton.Right)
|
|
||||||
{
|
|
||||||
State = CurrentFrame?.MouseRight ?? false
|
|
||||||
},
|
|
||||||
}
|
|
||||||
),
|
|
||||||
Keyboard = new ReplayKeyboardState(new List<Key>())
|
Keyboard = new ReplayKeyboardState(new List<Key>())
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -171,10 +165,10 @@ namespace osu.Game.Modes
|
|||||||
|
|
||||||
private class ReplayMouseState : MouseState
|
private class ReplayMouseState : MouseState
|
||||||
{
|
{
|
||||||
public ReplayMouseState(Vector2 position, List<ButtonState> list)
|
public ReplayMouseState(Vector2 position, IEnumerable<MouseButton> list)
|
||||||
{
|
{
|
||||||
Position = position;
|
Position = position;
|
||||||
ButtonStates = list;
|
list.ForEach(b => PressedButtons.Add(b));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,14 +70,14 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
if (mouseDisabled.Value)
|
if (mouseDisabled.Value)
|
||||||
{
|
{
|
||||||
mouse.ButtonStates.Find(s => s.Button == MouseButton.Left).State = false;
|
mouse.PressedButtons.Remove(MouseButton.Left);
|
||||||
mouse.ButtonStates.Find(s => s.Button == MouseButton.Right).State = false;
|
mouse.PressedButtons.Remove(MouseButton.Right);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (leftViaKeyboard)
|
if (leftViaKeyboard)
|
||||||
mouse.ButtonStates.Find(s => s.Button == MouseButton.Left).State = true;
|
mouse.PressedButtons.Add(MouseButton.Left);
|
||||||
if (rightViaKeyboard)
|
if (rightViaKeyboard)
|
||||||
mouse.ButtonStates.Find(s => s.Button == MouseButton.Right).State = true;
|
mouse.PressedButtons.Add(MouseButton.Right);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user