Adjust ChangelogBuild appearance

This commit is contained in:
Andrei Zavatski
2020-02-21 17:11:29 +03:00
parent e9f69d2c23
commit 70eb2ed09e

View File

@ -51,28 +51,27 @@ namespace osu.Game.Overlays.Changelog
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours, OverlayColourProvider colourProvider)
{ {
foreach (var categoryEntries in Build.ChangelogEntries.GroupBy(b => b.Category).OrderBy(c => c.Key)) foreach (var categoryEntries in Build.ChangelogEntries.GroupBy(b => b.Category).OrderBy(c => c.Key))
{ {
ChangelogEntries.Add(new OsuSpriteText ChangelogEntries.Add(new OsuSpriteText
{ {
Text = categoryEntries.Key, Text = categoryEntries.Key,
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 24), Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 18),
Margin = new MarginPadding { Top = 35, Bottom = 15 }, Margin = new MarginPadding { Top = 35, Bottom = 15 },
}); });
var fontLarge = OsuFont.GetFont(size: 18); var fontLarge = OsuFont.GetFont(size: 16);
var fontMedium = OsuFont.GetFont(size: 14); var fontMedium = OsuFont.GetFont(size: 12);
var fontSmall = OsuFont.GetFont(size: 12);
foreach (APIChangelogEntry entry in categoryEntries) foreach (var entry in categoryEntries)
{ {
var entryColour = entry.Major ? colours.YellowLight : Color4.White; var entryColour = entry.Major ? colours.YellowLight : Color4.White;
LinkFlowContainer title; LinkFlowContainer title;
Container titleContainer = new Container var titleContainer = new Container
{ {
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
@ -83,7 +82,7 @@ namespace osu.Game.Overlays.Changelog
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Size = new Vector2(fontSmall.Size), Size = new Vector2(10),
Icon = entry.Type == ChangelogEntryType.Fix ? FontAwesome.Solid.Check : FontAwesome.Solid.Plus, Icon = entry.Type == ChangelogEntryType.Fix ? FontAwesome.Solid.Check : FontAwesome.Solid.Plus,
Colour = entryColour, Colour = entryColour,
Margin = new MarginPadding { Right = 5 }, Margin = new MarginPadding { Right = 5 },
@ -123,9 +122,9 @@ namespace osu.Game.Overlays.Changelog
}); });
} }
title.AddText(" by ", t => title.AddText(" by ", t =>
{ {
t.Font = fontMedium; t.Font = fontMedium.With(italics: true);
t.Colour = entryColour; t.Colour = entryColour;
}); });
@ -137,7 +136,7 @@ namespace osu.Game.Overlays.Changelog
Id = entry.GithubUser.UserId.Value Id = entry.GithubUser.UserId.Value
}, t => }, t =>
{ {
t.Font = fontMedium; t.Font = fontMedium.With(italics: true);
t.Colour = entryColour; t.Colour = entryColour;
}); });
} }
@ -145,7 +144,7 @@ namespace osu.Game.Overlays.Changelog
{ {
title.AddLink(entry.GithubUser.DisplayName, entry.GithubUser.GithubUrl, t => title.AddLink(entry.GithubUser.DisplayName, entry.GithubUser.GithubUrl, t =>
{ {
t.Font = fontMedium; t.Font = fontMedium.With(italics: true);
t.Colour = entryColour; t.Colour = entryColour;
}); });
} }
@ -153,7 +152,7 @@ namespace osu.Game.Overlays.Changelog
{ {
title.AddText(entry.GithubUser.DisplayName, t => title.AddText(entry.GithubUser.DisplayName, t =>
{ {
t.Font = fontSmall; t.Font = fontMedium.With(italics: true);
t.Colour = entryColour; t.Colour = entryColour;
}); });
} }
@ -162,7 +161,7 @@ namespace osu.Game.Overlays.Changelog
if (!string.IsNullOrEmpty(entry.MessageHtml)) if (!string.IsNullOrEmpty(entry.MessageHtml))
{ {
TextFlowContainer message = new TextFlowContainer var message = new TextFlowContainer
{ {
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
@ -171,8 +170,8 @@ namespace osu.Game.Overlays.Changelog
// todo: use markdown parsing once API returns markdown // todo: use markdown parsing once API returns markdown
message.AddText(WebUtility.HtmlDecode(Regex.Replace(entry.MessageHtml, @"<(.|\n)*?>", string.Empty)), t => message.AddText(WebUtility.HtmlDecode(Regex.Replace(entry.MessageHtml, @"<(.|\n)*?>", string.Empty)), t =>
{ {
t.Font = fontSmall; t.Font = fontMedium;
t.Colour = new Color4(235, 184, 254, 255); t.Colour = colourProvider.Foreground1;
}); });
ChangelogEntries.Add(message); ChangelogEntries.Add(message);