mirror of
https://github.com/ppy/osu.git
synced 2024-12-18 07:22:57 +08:00
32 lines
999 B
C#
32 lines
999 B
C#
|
// 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.Configuration;
|
||
|
using osu.Framework.Graphics;
|
||
|
using osu.Framework.Graphics.Containers;
|
||
|
using osu.Game.Graphics;
|
||
|
using osu.Game.Online.Multiplayer;
|
||
|
|
||
|
namespace osu.Game.Screens.Multi.Components
|
||
|
{
|
||
|
public class StatusColouredContainer : Container
|
||
|
{
|
||
|
private readonly double transitionDuration;
|
||
|
|
||
|
[Resolved(typeof(Room), nameof(Room.Status))]
|
||
|
private Bindable<RoomStatus> status { get; set; }
|
||
|
|
||
|
public StatusColouredContainer(double transitionDuration = 100)
|
||
|
{
|
||
|
this.transitionDuration = transitionDuration;
|
||
|
}
|
||
|
|
||
|
[BackgroundDependencyLoader]
|
||
|
private void load(OsuColour colours)
|
||
|
{
|
||
|
status.BindValueChanged(s => this.FadeColour(s.GetAppropriateColour(colours), transitionDuration), true);
|
||
|
}
|
||
|
}
|
||
|
}
|