mirror of
https://github.com/ppy/osu.git
synced 2025-03-21 23:27:21 +08:00
Merge pull request #4332 from jorolf/supporter-disclaimer
Don't show the supporter text if the user already has supporter status
This commit is contained in:
commit
35ffccc2a5
@ -5,14 +5,17 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Online.API;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
@ -33,13 +36,15 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
private const float icon_y = -85;
|
||||
|
||||
private readonly Bindable<User> currentUser = new Bindable<User>();
|
||||
|
||||
public Disclaimer()
|
||||
{
|
||||
ValidForResume = false;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
private void load(OsuColour colours, APIAccess api)
|
||||
{
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
@ -96,6 +101,13 @@ namespace osu.Game.Screens.Menu
|
||||
}).First());
|
||||
|
||||
iconColour = colours.Yellow;
|
||||
|
||||
currentUser.BindTo(api.LocalUser);
|
||||
currentUser.BindValueChanged(e =>
|
||||
{
|
||||
if (e.NewValue.IsSupporter)
|
||||
supporterDrawables.ForEach(d => d.FadeOut(500, Easing.OutQuint).Expire());
|
||||
}, true);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
Loading…
x
Reference in New Issue
Block a user