1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Fix broken testcase and apply suggested changes

This commit is contained in:
EVAST9919 2017-09-27 01:10:48 +03:00
parent 3cd6319ffa
commit c696f74578
5 changed files with 20 additions and 20 deletions

View File

@ -35,7 +35,7 @@ namespace osu.Game.Screens.Play.BreaksOverlay
{
Anchor = Anchor.Centre,
Origin = Anchor.CentreRight,
X = - glow_icon_offscreen_offset,
X = -glow_icon_offscreen_offset,
Icon = Graphics.FontAwesome.fa_chevron_right,
BlurSigma = new Vector2(glow_icon_blur_sigma),
Size = new Vector2(glow_icon_size),
@ -59,7 +59,7 @@ namespace osu.Game.Screens.Play.BreaksOverlay
Anchor = Anchor.Centre,
Origin = Anchor.CentreRight,
Alpha = 0.7f,
X = - blurred_icon_offscreen_offset,
X = -blurred_icon_offscreen_offset,
Icon = Graphics.FontAwesome.fa_chevron_right,
BlurSigma = new Vector2(blurred_icon_blur_sigma),
Size = new Vector2(blurred_icon_size),

View File

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

View File

@ -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"),
},
}
};

View File

@ -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,
}

View File

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