mirror of
https://github.com/osukey/osukey.git
synced 2025-05-16 02:57:32 +09:00
Move StatusColouredContainer into a more public location
This commit is contained in:
parent
2d61548251
commit
1e0135af6f
31
osu.Game/Screens/Multi/Components/StatusColouredContainer.cs
Normal file
31
osu.Game/Screens/Multi/Components/StatusColouredContainer.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -95,7 +95,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new StatusColouredContainer
|
new StatusColouredContainer(transition_duration)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = selectionBox
|
Child = selectionBox
|
||||||
@ -122,7 +122,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = OsuColour.FromHex(@"212121"),
|
Colour = OsuColour.FromHex(@"212121"),
|
||||||
},
|
},
|
||||||
new StatusColouredContainer
|
new StatusColouredContainer(transition_duration)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = side_strip_width,
|
Width = side_strip_width,
|
||||||
@ -210,17 +210,5 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
Current = name;
|
Current = name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class StatusColouredContainer : Container
|
|
||||||
{
|
|
||||||
[Resolved(typeof(Room), nameof(Online.Multiplayer.Room.Status))]
|
|
||||||
private Bindable<RoomStatus> status { get; set; }
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colours)
|
|
||||||
{
|
|
||||||
status.BindValueChanged(s => this.FadeColour(s.GetAppropriateColour(colours), transition_duration), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user