mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 06:52:55 +08: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);
|
||||
}
|
||||
|
||||
private void checkRequestCount(int expected) =>
|
||||
AddAssert($"request count is {expected}", () => requestCount == expected);
|
||||
private void checkRequestCount(int expected)
|
||||
{
|
||||
AddAssert($"skip count is {expected}", () => skip.SkipCount, () => Is.EqualTo(expected));
|
||||
AddAssert($"request count is {expected}", () => requestCount, () => Is.EqualTo(expected));
|
||||
}
|
||||
|
||||
private class TestSkipOverlay : SkipOverlay
|
||||
{
|
||||
|
@ -27,6 +27,11 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
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;
|
||||
|
||||
public Action RequestSkip;
|
||||
@ -124,7 +129,11 @@ namespace osu.Game.Screens.Play
|
||||
return;
|
||||
}
|
||||
|
||||
button.Action = () => RequestSkip?.Invoke();
|
||||
button.Action = () =>
|
||||
{
|
||||
SkipCount++;
|
||||
RequestSkip?.Invoke();
|
||||
};
|
||||
|
||||
fadeContainer.TriggerShow();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user