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

View File

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

View File

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

View File

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

View File

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