mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Add total skip count to SkipOverlay
This commit is contained in:
parent
cb51fc7384
commit
aef3c7918c
@ -137,8 +137,11 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
checkRequestCount(0);
|
checkRequestCount(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkRequestCount(int expected) =>
|
private void checkRequestCount(int expected)
|
||||||
AddAssert($"request count is {expected}", () => requestCount == expected);
|
{
|
||||||
|
AddAssert($"skip count is {expected}", () => skip.SkipCount, () => Is.EqualTo(expected));
|
||||||
|
AddAssert($"request count is {expected}", () => requestCount, () => Is.EqualTo(expected));
|
||||||
|
}
|
||||||
|
|
||||||
private class TestSkipOverlay : SkipOverlay
|
private class TestSkipOverlay : SkipOverlay
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,11 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
public class SkipOverlay : CompositeDrawable, IKeyBindingHandler<GlobalAction>
|
public class SkipOverlay : CompositeDrawable, IKeyBindingHandler<GlobalAction>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The total number of successful skips performed by this overlay.
|
||||||
|
/// </summary>
|
||||||
|
public int SkipCount { get; private set; }
|
||||||
|
|
||||||
private readonly double startTime;
|
private readonly double startTime;
|
||||||
|
|
||||||
public Action RequestSkip;
|
public Action RequestSkip;
|
||||||
@ -124,7 +129,11 @@ namespace osu.Game.Screens.Play
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
button.Action = () => RequestSkip?.Invoke();
|
button.Action = () =>
|
||||||
|
{
|
||||||
|
SkipCount++;
|
||||||
|
RequestSkip?.Invoke();
|
||||||
|
};
|
||||||
|
|
||||||
fadeContainer.TriggerShow();
|
fadeContainer.TriggerShow();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user