diff --git a/osu.Game/Graphics/Cursor/CursorTrail.cs b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs similarity index 96% rename from osu.Game/Graphics/Cursor/CursorTrail.cs rename to osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs index 035f6f98b0..a5be6a7952 100644 --- a/osu.Game/Graphics/Cursor/CursorTrail.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs @@ -1,22 +1,22 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using System.Diagnostics; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; +using osu.Framework.Graphics.OpenGL.Buffers; +using osu.Framework.Graphics.OpenGL.Vertices; +using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Shaders; using osu.Framework.Graphics.Textures; using osu.Framework.Input; -using OpenTK; -using System; -using osu.Framework.Graphics.OpenGL.Buffers; -using OpenTK.Graphics.ES30; -using osu.Framework.Graphics.Primitives; -using osu.Framework.Graphics.Colour; using osu.Framework.Timing; -using System.Diagnostics; -using osu.Framework.Graphics.OpenGL.Vertices; +using OpenTK; +using OpenTK.Graphics.ES30; -namespace osu.Game.Graphics.Cursor +namespace osu.Game.Rulesets.Osu.UI.Cursor { internal class CursorTrail : Drawable { diff --git a/osu.Game/Graphics/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs similarity index 80% rename from osu.Game/Graphics/Cursor/GameplayCursor.cs rename to osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 9f771ae56d..79331d9414 100644 --- a/osu.Game/Graphics/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -1,8 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Extensions.Color4Extensions; @@ -13,8 +11,10 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Input; using osu.Game.Beatmaps; using osu.Game.Configuration; +using OpenTK; +using OpenTK.Graphics; -namespace osu.Game.Graphics.Cursor +namespace osu.Game.Rulesets.Osu.UI.Cursor { public class GameplayCursor : CursorContainer { @@ -25,18 +25,40 @@ namespace osu.Game.Graphics.Cursor Add(new CursorTrail { Depth = 1 }); } - protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) + private int downCount; + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { - ActiveCursor.Scale = new Vector2(1); - ActiveCursor.ScaleTo(1.2f, 100, Easing.OutQuad); - return base.OnMouseDown(state, args); + if (state.Data is OsuAction) + { + switch ((OsuAction)state.Data) + { + case OsuAction.LeftButton: + case OsuAction.RightButton: + downCount++; + ActiveCursor.ScaleTo(1).ScaleTo(1.2f, 100, Easing.OutQuad); + break; + } + } + + return false; } - protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) + protected override bool OnKeyUp(InputState state, KeyUpEventArgs args) { - if (!state.Mouse.HasMainButtonPressed) - ActiveCursor.ScaleTo(1, 200, Easing.OutQuad); - return base.OnMouseUp(state, args); + if (state.Data is OsuAction) + { + switch ((OsuAction)state.Data) + { + case OsuAction.LeftButton: + case OsuAction.RightButton: + if (--downCount == 0) + ActiveCursor.ScaleTo(1, 200, Easing.OutQuad); + break; + } + } + + return false; } public class OsuCursor : Container diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index 2604b1ee8a..9b88c9d1b3 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -10,8 +10,8 @@ using osu.Game.Rulesets.Osu.Objects.Drawables; using osu.Game.Rulesets.Osu.Objects.Drawables.Connections; using osu.Game.Rulesets.UI; using System.Linq; -using osu.Game.Graphics.Cursor; using osu.Game.Rulesets.Osu.Judgements; +using osu.Game.Rulesets.Osu.UI.Cursor; namespace osu.Game.Rulesets.Osu.UI { diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 0b960d6607..1422ded407 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -78,6 +78,8 @@ + + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 9d849b9d67..7c21d64312 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -145,8 +145,6 @@ - -