2020-06-08 21:45:40 +00:00
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
using osu.Game.Online.API;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Bindables;
|
2021-11-04 09:02:44 +00:00
|
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
2020-06-08 21:45:40 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Menu
|
|
|
|
|
{
|
|
|
|
|
internal class MenuLogoVisualisation : LogoVisualisation
|
|
|
|
|
{
|
2021-11-04 09:02:44 +00:00
|
|
|
|
private IBindable<APIUser> user;
|
2020-06-08 21:45:40 +00:00
|
|
|
|
private Bindable<Skin> skin;
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(IAPIProvider api, SkinManager skinManager)
|
|
|
|
|
{
|
|
|
|
|
user = api.LocalUser.GetBoundCopy();
|
|
|
|
|
skin = skinManager.CurrentSkin.GetBoundCopy();
|
|
|
|
|
|
|
|
|
|
user.ValueChanged += _ => updateColour();
|
|
|
|
|
skin.BindValueChanged(_ => updateColour(), true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void updateColour()
|
|
|
|
|
{
|
|
|
|
|
if (user.Value?.IsSupporter ?? false)
|
2020-11-23 04:35:13 +00:00
|
|
|
|
Colour = skin.Value.GetConfig<GlobalSkinColours, Color4>(GlobalSkinColours.MenuGlow)?.Value ?? Color4.White;
|
2020-06-08 21:45:40 +00:00
|
|
|
|
else
|
2020-11-23 04:35:13 +00:00
|
|
|
|
Colour = Color4.White;
|
2020-06-08 21:45:40 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|