Merge pull request #4240 from ThePyrotechnic/MissingSource

Improve layout of beatmap details pane when source is unknown
This commit is contained in:
Dean Herbert 2019-02-26 16:20:23 +09:00 committed by GitHub
commit a11a7fa6f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 5 deletions

View File

@ -21,7 +21,7 @@ public TestCaseBeatmapDetails()
Padding = new MarginPadding(150),
});
AddStep("beatmap all metrics", () => details.Beatmap = new BeatmapInfo
AddStep("all metrics", () => details.Beatmap = new BeatmapInfo
{
Version = "All Metrics",
Metadata = new BeatmapMetadata
@ -45,7 +45,30 @@ public TestCaseBeatmapDetails()
},
});
AddStep("beatmap ratings", () => details.Beatmap = new BeatmapInfo
AddStep("all except source", () => details.Beatmap = new BeatmapInfo
{
Version = "All Metrics",
Metadata = new BeatmapMetadata
{
Tags = "this beatmap has all the metrics",
},
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 7,
DrainRate = 1,
OverallDifficulty = 5.7f,
ApproachRate = 3.5f,
},
StarDifficulty = 5.3f,
Metrics = new BeatmapMetrics
{
Ratings = Enumerable.Range(0, 11),
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
},
});
AddStep("ratings", () => details.Beatmap = new BeatmapInfo
{
Version = "Only Ratings",
Metadata = new BeatmapMetadata
@ -67,7 +90,7 @@ public TestCaseBeatmapDetails()
},
});
AddStep("beatmap fails retries", () => details.Beatmap = new BeatmapInfo
AddStep("fails retries", () => details.Beatmap = new BeatmapInfo
{
Version = "Only Retries and Fails",
Metadata = new BeatmapMetadata
@ -90,7 +113,7 @@ public TestCaseBeatmapDetails()
},
});
AddStep("beatmap no metrics", () => details.Beatmap = new BeatmapInfo
AddStep("no metrics", () => details.Beatmap = new BeatmapInfo
{
Version = "No Metrics",
Metadata = new BeatmapMetadata

View File

@ -116,6 +116,7 @@ public BeatmapDetails()
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
LayoutDuration = transition_duration,
LayoutEasing = Easing.OutQuad,
Spacing = new Vector2(spacing * 2),
Margin = new MarginPadding { Top = spacing * 2 },
Children = new[]
@ -336,10 +337,12 @@ public string Text
{
if (string.IsNullOrEmpty(value))
{
textContainer.FadeOut(transition_duration);
this.FadeOut(transition_duration);
return;
}
this.FadeIn(transition_duration);
setTextAsync(value);
}
}