CI fixes.

This commit is contained in:
DrabWeb
2017-09-12 23:41:10 -03:00
parent 08b5d4e16c
commit 97e5a0d4a3
9 changed files with 1040 additions and 1033 deletions

View File

@ -5,15 +5,14 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Testing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Users; using osu.Game.Users;
namespace osu.Desktop.VisualTests.Tests namespace osu.Desktop.Tests.Visual
{ {
internal class TestCaseOnlineBeatmapSetOverlay : TestCase internal class TestCaseOnlineBeatmapSetOverlay : OsuTestCase
{ {
public override string Description => @"view online beatmap sets"; public override string Description => @"view online beatmap sets";

View File

@ -25,12 +25,12 @@ namespace osu.Game.Beatmaps
/// <summary> /// <summary>
/// The date this beatmap set was ranked. /// The date this beatmap set was ranked.
/// </summary> /// </summary>
public DateTimeOffset Ranked { get; set; } public DateTimeOffset? Ranked { get; set; }
/// <summary> /// <summary>
/// The date this beatmap set was last updated. /// The date this beatmap set was last updated.
/// </summary> /// </summary>
public DateTimeOffset LastUpdated { get; set; } public DateTimeOffset? LastUpdated { get; set; }
/// <summary> /// <summary>
/// The different sizes of cover art for this beatmap set. /// The different sizes of cover art for this beatmap set.

View File

@ -21,6 +21,7 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = height; Height = height;
FillFlowContainer fields;
Children = new Drawable[] Children = new Drawable[]
{ {
new UpdateableAvatar new UpdateableAvatar
@ -37,7 +38,7 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
Offset = new Vector2(0f, 1f), Offset = new Vector2(0f, 1f),
}, },
}, },
new FillFlowContainer fields = new FillFlowContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
@ -49,10 +50,18 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
{ {
Margin = new MarginPadding { Top = 5 }, Margin = new MarginPadding { Top = 5 },
}, },
new Field(info.Ranked == null ? "last updated on " : "ranked on ", (info.Ranked == null ? info.Submitted : info.Ranked).ToString(@"MMM d, yyyy"), @"Exo2.0-Bold"),
}, },
}, },
}; };
if (info.Ranked.HasValue)
{
fields.Add(new Field("ranked on ", info.Ranked.Value.ToString(@"MMM d, yyyy"), @"Exo2.0-Bold"));
}
else if (info.LastUpdated.HasValue)
{
fields.Add(new Field("last updated on ", info.LastUpdated.Value.ToString(@"MMM d, yyyy"), @"Exo2.0-Bold"));
}
} }
private class Field : FillFlowContainer private class Field : FillFlowContainer

View File

@ -27,14 +27,13 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
beatmap = value; beatmap = value;
length.Value = TimeSpan.FromMilliseconds(beatmap.OnlineInfo.Length).ToString(@"m\:ss"); length.Value = TimeSpan.FromMilliseconds(beatmap.OnlineInfo.Length).ToString(@"m\:ss");
circleCount.Value = string.Format(@"{0:n0}", beatmap.OnlineInfo.CircleCount); circleCount.Value = beatmap.OnlineInfo.CircleCount.ToString("N0");
sliderCount.Value = string.Format(@"{0:n0}", beatmap.OnlineInfo.SliderCount); sliderCount.Value = beatmap.OnlineInfo.SliderCount.ToString("N0");
} }
} }
public BasicStats(BeatmapSetInfo set) public BasicStats(BeatmapSetInfo set)
{ {
var statWidth = 0.25f;
Child = new FillFlowContainer Child = new FillFlowContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
@ -42,14 +41,14 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Children = new[] Children = new[]
{ {
length = new Statistic(FontAwesome.fa_clock_o, "Length") { Width = statWidth }, length = new Statistic(FontAwesome.fa_clock_o, "Length") { Width = 0.25f },
new Statistic(FontAwesome.fa_circle, "BPM") new Statistic(FontAwesome.fa_circle, "BPM")
{ {
Width = statWidth, Width = 0.25f,
Value = set.OnlineInfo.BPM.ToString(@"0.##"), Value = set.OnlineInfo.BPM.ToString(@"0.##"),
}, },
circleCount = new Statistic(FontAwesome.fa_circle_o, "Circle Count") { Width = statWidth }, circleCount = new Statistic(FontAwesome.fa_circle_o, "Circle Count") { Width = 0.25f },
sliderCount = new Statistic(FontAwesome.fa_circle, "Slider Count") { Width = statWidth }, sliderCount = new Statistic(FontAwesome.fa_circle, "Slider Count") { Width = 0.25f },
}, },
}; };
} }

View File

@ -103,7 +103,7 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
OnHovered = beatmap => OnHovered = beatmap =>
{ {
showBeatmap(beatmap); showBeatmap(beatmap);
starRating.Text = string.Format("Star Difficulty {0:N2}", beatmap.StarDifficulty); starRating.Text = beatmap.StarDifficulty.ToString("Star Difficulty 0.##");
starRating.FadeIn(100); starRating.FadeIn(100);
}, },
}); });

View File

@ -80,7 +80,7 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
private class DetailBox : Container private class DetailBox : Container
{ {
private Container content; private readonly Container content;
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content => content;
public DetailBox() public DetailBox()

View File

@ -1,5 +1,5 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE] // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK; using OpenTK;
using osu.Framework.Configuration; using osu.Framework.Configuration;