1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 09:22:54 +08:00

Update colour of spotlights playlist to match new specs

This commit is contained in:
Dean Herbert 2022-05-27 20:19:03 +09:00
parent ef47b380c6
commit 883c6f1eb3

View File

@ -2,10 +2,12 @@
// 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 osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Online.Rooms;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Screens.OnlinePlay.Lounge.Components namespace osu.Game.Screens.OnlinePlay.Lounge.Components
@ -13,6 +15,10 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
public class RoomSpecialCategoryPill : OnlinePlayComposite public class RoomSpecialCategoryPill : OnlinePlayComposite
{ {
private SpriteText text; private SpriteText text;
private PillContainer pill;
[Resolved]
private OsuColour colours { get; set; }
public RoomSpecialCategoryPill() public RoomSpecialCategoryPill()
{ {
@ -20,9 +26,9 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load()
{ {
InternalChild = new PillContainer InternalChild = pill = new PillContainer
{ {
Background = Background =
{ {
@ -43,7 +49,21 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
{ {
base.LoadComplete(); base.LoadComplete();
Category.BindValueChanged(c => text.Text = c.NewValue.ToString(), true); Category.BindValueChanged(c =>
{
text.Text = c.NewValue.GetLocalisableDescription();
switch (c.NewValue)
{
case RoomCategory.Spotlight:
pill.Background.Colour = colours.Green2;
break;
case RoomCategory.FeaturedArtist:
pill.Background.Colour = colours.Blue2;
break;
}
}, true);
} }
} }
} }