mirror of
https://github.com/osukey/osukey.git
synced 2025-05-19 12:37:38 +09:00
Fix drawable room border colour not matching badge
This commit is contained in:
parent
2f57849bcb
commit
a94432f3bd
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
@ -188,6 +189,24 @@ namespace osu.Game.Graphics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves the main accent colour for a <see cref="RoomCategory"/>.
|
||||||
|
/// </summary>
|
||||||
|
public Color4? ForRoomCategory(RoomCategory roomCategory)
|
||||||
|
{
|
||||||
|
switch (roomCategory)
|
||||||
|
{
|
||||||
|
case RoomCategory.Spotlight:
|
||||||
|
return Green2;
|
||||||
|
|
||||||
|
case RoomCategory.FeaturedArtist:
|
||||||
|
return Blue2;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a foreground text colour that is supposed to contrast well with
|
/// Returns a foreground text colour that is supposed to contrast well with
|
||||||
/// the supplied <paramref name="backgroundColour"/>.
|
/// the supplied <paramref name="backgroundColour"/>.
|
||||||
|
@ -30,8 +30,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
|||||||
{
|
{
|
||||||
status.BindValueChanged(s =>
|
status.BindValueChanged(s =>
|
||||||
{
|
{
|
||||||
this.FadeColour(category.Value == RoomCategory.Spotlight ? colours.Pink : s.NewValue.GetAppropriateColour(colours)
|
this.FadeColour(colours.ForRoomCategory(category.Value) ?? s.NewValue.GetAppropriateColour(colours), transitionDuration);
|
||||||
, transitionDuration);
|
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ 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
|
||||||
@ -53,16 +52,9 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
|||||||
{
|
{
|
||||||
text.Text = c.NewValue.GetLocalisableDescription();
|
text.Text = c.NewValue.GetLocalisableDescription();
|
||||||
|
|
||||||
switch (c.NewValue)
|
var backgroundColour = colours.ForRoomCategory(Category.Value);
|
||||||
{
|
if (backgroundColour != null)
|
||||||
case RoomCategory.Spotlight:
|
pill.Background.Colour = backgroundColour.Value;
|
||||||
pill.Background.Colour = colours.Green2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RoomCategory.FeaturedArtist:
|
|
||||||
pill.Background.Colour = colours.Blue2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user