1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 02:52:54 +08:00
osu-lazer/osu.Game/Screens/Menu/MenuLogoVisualisation.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
1.2 KiB
C#
Raw Normal View History

// 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 osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Skinning;
using osuTK.Graphics;
namespace osu.Game.Screens.Menu
{
2024-12-20 14:04:37 +08:00
public partial class MenuLogoVisualisation : LogoVisualisation
{
2024-12-20 14:04:37 +08:00
private IBindable<APIUser> user = null!;
private Bindable<Skin> skin = null!;
[BackgroundDependencyLoader]
private void load(IAPIProvider api, SkinManager skinManager)
{
user = api.LocalUser.GetBoundCopy();
skin = skinManager.CurrentSkin.GetBoundCopy();
2024-12-20 14:04:37 +08:00
user.ValueChanged += _ => UpdateColour();
skin.BindValueChanged(_ => UpdateColour(), true);
}
2024-12-20 14:04:37 +08:00
protected virtual void UpdateColour()
{
2024-12-20 14:04:37 +08:00
if (user.Value?.IsSupporter ?? false)
2020-11-23 12:35:13 +08:00
Colour = skin.Value.GetConfig<GlobalSkinColours, Color4>(GlobalSkinColours.MenuGlow)?.Value ?? Color4.White;
else
2020-11-23 12:35:13 +08:00
Colour = Color4.White;
}
}
}