mirror of
https://github.com/osukey/osukey.git
synced 2025-07-18 00:39:53 +09:00
Move GameplayCursor to osu! ruleset and make work with OsuActions
This commit is contained in:
@ -1,22 +1,22 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// 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.Allocation;
|
||||||
using osu.Framework.Graphics;
|
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.Shaders;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Input;
|
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 osu.Framework.Timing;
|
||||||
using System.Diagnostics;
|
using OpenTK;
|
||||||
using osu.Framework.Graphics.OpenGL.Vertices;
|
using OpenTK.Graphics.ES30;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Cursor
|
namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||||
{
|
{
|
||||||
internal class CursorTrail : Drawable
|
internal class CursorTrail : Drawable
|
||||||
{
|
{
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// 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.Allocation;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
@ -13,8 +11,10 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Configuration;
|
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
|
public class GameplayCursor : CursorContainer
|
||||||
{
|
{
|
||||||
@ -25,18 +25,40 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
Add(new CursorTrail { Depth = 1 });
|
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);
|
if (state.Data is OsuAction)
|
||||||
ActiveCursor.ScaleTo(1.2f, 100, Easing.OutQuad);
|
{
|
||||||
return base.OnMouseDown(state, args);
|
switch ((OsuAction)state.Data)
|
||||||
|
{
|
||||||
|
case OsuAction.LeftButton:
|
||||||
|
case OsuAction.RightButton:
|
||||||
|
downCount++;
|
||||||
|
ActiveCursor.ScaleTo(1).ScaleTo(1.2f, 100, Easing.OutQuad);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
|
||||||
{
|
{
|
||||||
if (!state.Mouse.HasMainButtonPressed)
|
if (state.Data is OsuAction)
|
||||||
|
{
|
||||||
|
switch ((OsuAction)state.Data)
|
||||||
|
{
|
||||||
|
case OsuAction.LeftButton:
|
||||||
|
case OsuAction.RightButton:
|
||||||
|
if (--downCount == 0)
|
||||||
ActiveCursor.ScaleTo(1, 200, Easing.OutQuad);
|
ActiveCursor.ScaleTo(1, 200, Easing.OutQuad);
|
||||||
return base.OnMouseUp(state, args);
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OsuCursor : Container
|
public class OsuCursor : Container
|
@ -10,8 +10,8 @@ using osu.Game.Rulesets.Osu.Objects.Drawables;
|
|||||||
using osu.Game.Rulesets.Osu.Objects.Drawables.Connections;
|
using osu.Game.Rulesets.Osu.Objects.Drawables.Connections;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Graphics.Cursor;
|
|
||||||
using osu.Game.Rulesets.Osu.Judgements;
|
using osu.Game.Rulesets.Osu.Judgements;
|
||||||
|
using osu.Game.Rulesets.Osu.UI.Cursor;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.UI
|
namespace osu.Game.Rulesets.Osu.UI
|
||||||
{
|
{
|
||||||
|
@ -78,6 +78,8 @@
|
|||||||
<Compile Include="OsuDifficulty\Skills\Speed.cs" />
|
<Compile Include="OsuDifficulty\Skills\Speed.cs" />
|
||||||
<Compile Include="OsuDifficulty\Utils\History.cs" />
|
<Compile Include="OsuDifficulty\Utils\History.cs" />
|
||||||
<Compile Include="OsuInputManager.cs" />
|
<Compile Include="OsuInputManager.cs" />
|
||||||
|
<Compile Include="UI\Cursor\CursorTrail.cs" />
|
||||||
|
<Compile Include="UI\Cursor\GameplayCursor.cs" />
|
||||||
<Compile Include="UI\OsuSettings.cs" />
|
<Compile Include="UI\OsuSettings.cs" />
|
||||||
<Compile Include="Scoring\OsuScoreProcessor.cs" />
|
<Compile Include="Scoring\OsuScoreProcessor.cs" />
|
||||||
<Compile Include="UI\OsuRulesetContainer.cs" />
|
<Compile Include="UI\OsuRulesetContainer.cs" />
|
||||||
|
@ -145,8 +145,6 @@
|
|||||||
<Compile Include="Rulesets\RulesetInfo.cs" />
|
<Compile Include="Rulesets\RulesetInfo.cs" />
|
||||||
<Compile Include="Rulesets\Scoring\ScoreStore.cs" />
|
<Compile Include="Rulesets\Scoring\ScoreStore.cs" />
|
||||||
<Compile Include="Graphics\Backgrounds\Triangles.cs" />
|
<Compile Include="Graphics\Backgrounds\Triangles.cs" />
|
||||||
<Compile Include="Graphics\Cursor\CursorTrail.cs" />
|
|
||||||
<Compile Include="Graphics\Cursor\GameplayCursor.cs" />
|
|
||||||
<Compile Include="Graphics\IHasAccentColour.cs" />
|
<Compile Include="Graphics\IHasAccentColour.cs" />
|
||||||
<Compile Include="Graphics\Sprites\OsuSpriteText.cs" />
|
<Compile Include="Graphics\Sprites\OsuSpriteText.cs" />
|
||||||
<Compile Include="Graphics\UserInterface\BackButton.cs" />
|
<Compile Include="Graphics\UserInterface\BackButton.cs" />
|
||||||
|
Reference in New Issue
Block a user