mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 09:23:06 +08:00
add Single Tap mod
This commit is contained in:
parent
f90f93a43c
commit
c05263c3c3
38
osu.Game.Rulesets.Osu/Mods/OsuModSingleTap.cs
Normal file
38
osu.Game.Rulesets.Osu/Mods/OsuModSingleTap.cs
Normal file
@ -0,0 +1,38 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public class OsuModSingleTap : InputBlockingMod
|
||||
{
|
||||
public override string Name => @"Single Tap";
|
||||
public override string Acronym => @"ST";
|
||||
public override string Description => @"You must only use one key!";
|
||||
|
||||
protected override bool CheckCorrectAction(OsuAction action)
|
||||
{
|
||||
if (base.CheckCorrectAction(action))
|
||||
return true;
|
||||
|
||||
if (LastActionPressed == null)
|
||||
{
|
||||
// First keypress, store the expected action.
|
||||
LastActionPressed = action;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (LastActionPressed == action)
|
||||
{
|
||||
// User singletapped correctly.
|
||||
return true;
|
||||
}
|
||||
|
||||
Ruleset.Cursor.FlashColour(Colour4.Red, FLASH_DURATION, Easing.OutQuint);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -172,7 +172,7 @@ namespace osu.Game.Rulesets.Osu
|
||||
new OsuModClassic(),
|
||||
new OsuModRandom(),
|
||||
new OsuModMirror(),
|
||||
new OsuModAlternate(),
|
||||
new MultiMod(new OsuModAlternate(), new OsuModSingleTap())
|
||||
};
|
||||
|
||||
case ModType.Automation:
|
||||
|
Loading…
Reference in New Issue
Block a user