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