1
0
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:
Dean Herbert 2022-11-03 12:14:37 +09:00
parent cb51fc7384
commit aef3c7918c
2 changed files with 15 additions and 3 deletions

View File

@ -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
{

View File

@ -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();