mirror of
https://github.com/osukey/osukey.git
synced 2025-07-09 20:29:57 +09:00
Fix broken testcase and apply suggested changes
This commit is contained in:
@ -104,7 +104,7 @@ namespace osu.Game.Screens.Play.BreaksOverlay
|
||||
.Then()
|
||||
.ResizeWidthTo(0, b.Duration - fade_duration);
|
||||
|
||||
Scheduler.AddDelayed(() => remainingTimeCounter.StartCounting(b.EndTime), b.StartTime);
|
||||
Scheduler.AddDelayed(() => remainingTimeCounter.StartCounting(b.EndTime), b.StartTime - Clock.CurrentTime);
|
||||
remainingTimeCounter.FadeIn(fade_duration);
|
||||
|
||||
info.FadeIn(fade_duration);
|
||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Screens.Play.BreaksOverlay
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Text = @"current progress".ToUpper(),
|
||||
Text = "current progress".ToUpper(),
|
||||
TextSize = 15,
|
||||
Font = "Exo2.0-Black",
|
||||
},
|
||||
@ -38,9 +38,9 @@ namespace osu.Game.Screens.Play.BreaksOverlay
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
AccuracyDisplay = new PercentageInfoLine(@"Accuracy"),
|
||||
RankDisplay = new InfoLine<int>(@"Rank", @"#"),
|
||||
GradeDisplay = new GradeInfoLine(@"Grade"),
|
||||
AccuracyDisplay = new PercentageInfoLine("Accuracy"),
|
||||
RankDisplay = new InfoLine<int>("Rank", @"#"),
|
||||
GradeDisplay = new GradeInfoLine("Grade"),
|
||||
},
|
||||
}
|
||||
};
|
||||
|
@ -11,9 +11,9 @@ namespace osu.Game.Screens.Play.BreaksOverlay
|
||||
{
|
||||
public class LetterboxOverlay : Container
|
||||
{
|
||||
private const int letterbox_height = 350;
|
||||
private const int height = 350;
|
||||
|
||||
private Color4 transparentBlack => new Color4(0, 0, 0, 0);
|
||||
private static readonly Color4 transparent_black = new Color4(0, 0, 0, 0);
|
||||
|
||||
public LetterboxOverlay()
|
||||
{
|
||||
@ -26,7 +26,7 @@ namespace osu.Game.Screens.Play.BreaksOverlay
|
||||
Anchor = Anchor.TopLeft,
|
||||
Origin = Anchor.TopLeft,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = letterbox_height,
|
||||
Height = height,
|
||||
Child = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
@ -34,8 +34,8 @@ namespace osu.Game.Screens.Play.BreaksOverlay
|
||||
{
|
||||
TopLeft = Color4.Black,
|
||||
TopRight = Color4.Black,
|
||||
BottomLeft = transparentBlack,
|
||||
BottomRight = transparentBlack,
|
||||
BottomLeft = transparent_black,
|
||||
BottomRight = transparent_black,
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -44,14 +44,14 @@ namespace osu.Game.Screens.Play.BreaksOverlay
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = letterbox_height,
|
||||
Height = height,
|
||||
Child = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = new ColourInfo
|
||||
{
|
||||
TopLeft = transparentBlack,
|
||||
TopRight = transparentBlack,
|
||||
TopLeft = transparent_black,
|
||||
TopRight = transparent_black,
|
||||
BottomLeft = Color4.Black,
|
||||
BottomRight = Color4.Black,
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ namespace osu.Game.Screens.Play.BreaksOverlay
|
||||
|
||||
private int? previousSecond;
|
||||
|
||||
private double remainingTime;
|
||||
private double endTime;
|
||||
|
||||
private bool isCounting;
|
||||
|
||||
@ -31,9 +31,9 @@ namespace osu.Game.Screens.Play.BreaksOverlay
|
||||
};
|
||||
}
|
||||
|
||||
public void StartCounting(double remainingTime)
|
||||
public void StartCounting(double endTime)
|
||||
{
|
||||
this.remainingTime = remainingTime;
|
||||
this.endTime = endTime;
|
||||
isCounting = true;
|
||||
}
|
||||
|
||||
@ -44,9 +44,9 @@ namespace osu.Game.Screens.Play.BreaksOverlay
|
||||
if (isCounting)
|
||||
{
|
||||
var currentTime = Clock.CurrentTime;
|
||||
if (currentTime < remainingTime)
|
||||
if (currentTime < endTime)
|
||||
{
|
||||
int currentSecond = (int)Math.Floor((remainingTime - Clock.CurrentTime) / 1000.0);
|
||||
int currentSecond = (int)Math.Floor((endTime - Clock.CurrentTime) / 1000.0);
|
||||
if (currentSecond != previousSecond)
|
||||
{
|
||||
counter.Text = currentSecond.ToString();
|
||||
|
Reference in New Issue
Block a user