1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 00:53:19 +08:00

Further minor refactoring

This commit is contained in:
Dean Herbert 2019-05-23 12:41:45 +09:00
parent 5a887dabfe
commit 7229975fef
2 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using Humanizer;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Audio.Sample; using osu.Framework.Audio.Sample;
@ -14,6 +15,7 @@ using osu.Game.Online.API.Requests.Responses;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Overlays.Changelog namespace osu.Game.Overlays.Changelog
@ -37,9 +39,9 @@ namespace osu.Game.Overlays.Changelog
public UpdateStreamBadge(APIUpdateStream stream) public UpdateStreamBadge(APIUpdateStream stream)
: base(stream) : base(stream)
{ {
Height = badge_height; Size = new Vector2(stream.IsFeatured ? badge_width * 2 : badge_width, badge_height);
Width = stream.IsFeatured ? badge_width * 2 : badge_width;
Padding = new MarginPadding(5); Padding = new MarginPadding(5);
Child = fadeContainer = new Container Child = fadeContainer = new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -65,7 +67,7 @@ namespace osu.Game.Overlays.Changelog
}, },
new OsuSpriteText new OsuSpriteText
{ {
Text = stream.LatestBuild.Users > 0 ? $"{stream.LatestBuild.Users:N0} users online" : null, Text = stream.LatestBuild.Users > 0 ? $"{stream.LatestBuild.Users:N0} {"user".Pluralize(stream.LatestBuild.Users == 1)} online" : null,
Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 10), Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 10),
Colour = new Color4(203, 164, 218, 255), Colour = new Color4(203, 164, 218, 255),
}, },

View File

@ -31,7 +31,8 @@ namespace osu.Game.Overlays.Changelog
{ {
Current.Value = null; Current.Value = null;
foreach (APIUpdateStream updateStream in streams) AddItem(updateStream); foreach (APIUpdateStream updateStream in streams)
AddItem(updateStream);
} }
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)