Skip to content

Commit

Permalink
Rename last action to better represent that it is only captured actions
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Jul 13, 2022
1 parent 4d9494d commit e2f2d5f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions osu.Game.Rulesets.Osu/Mods/InputBlockingMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public abstract class InputBlockingMod : Mod, IApplicableToDrawableRuleset<OsuHi

private DrawableRuleset<OsuHitObject> ruleset = null!;

protected OsuAction? LastActionPressed { get; private set; }
protected OsuAction? LastAcceptedAction { get; private set; }

/// <summary>
/// A tracker for periods where alternate should not be forced (i.e. non-gameplay periods).
Expand Down Expand Up @@ -68,7 +68,7 @@ private bool checkCorrectAction(OsuAction action)
{
if (nonGameplayPeriods.IsInAny(gameplayClock.CurrentTime))
{
LastActionPressed = null;
LastAcceptedAction = null;
return true;
}

Expand All @@ -85,7 +85,7 @@ private bool checkCorrectAction(OsuAction action)

if (CheckValidNewAction(action))
{
LastActionPressed = action;
LastAcceptedAction = action;
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Osu/Mods/OsuModAlternate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public class OsuModAlternate : InputBlockingMod
public override IconUsage? Icon => FontAwesome.Solid.Keyboard;
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModSingleTap) }).ToArray();

protected override bool CheckValidNewAction(OsuAction action) => LastActionPressed != action;
protected override bool CheckValidNewAction(OsuAction action) => LastAcceptedAction != action;
}
}
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Osu/Mods/OsuModSingleTap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public class OsuModSingleTap : InputBlockingMod
public override string Description => @"You must only use one key!";
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAlternate) }).ToArray();

protected override bool CheckValidNewAction(OsuAction action) => LastActionPressed == null || LastActionPressed == action;
protected override bool CheckValidNewAction(OsuAction action) => LastAcceptedAction == null || LastAcceptedAction == action;
}
}

0 comments on commit e2f2d5f

Please sign in to comment.