mirror of
https://github.com/ppy/osu.git
synced 2025-03-23 18:10:01 +08:00
Apply NRT and simplify some remaining code
This commit is contained in:
parent
e97d027230
commit
730bc3a961
@ -20,8 +20,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
|
||||
private void onMatchTypeChanged(ValueChangedEvent<MatchType> type)
|
||||
{
|
||||
TextFlow.Clear();
|
||||
TextFlow.AddText(type.NewValue.GetLocalisableDescription());
|
||||
TextFlow.Text = type.NewValue.GetLocalisableDescription();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,6 @@
|
||||
// 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.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
@ -12,8 +10,8 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
{
|
||||
public abstract partial class OnlinePlayPill : OnlinePlayComposite
|
||||
{
|
||||
protected PillContainer Pill;
|
||||
protected OsuTextFlowContainer TextFlow;
|
||||
protected PillContainer Pill { get; private set; } = null!;
|
||||
protected OsuTextFlowContainer TextFlow { get; private set; } = null!;
|
||||
|
||||
protected OnlinePlayPill()
|
||||
{
|
||||
|
@ -20,8 +20,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
|
||||
private void onQueueModeChanged(ValueChangedEvent<QueueMode> mode)
|
||||
{
|
||||
TextFlow.Clear();
|
||||
TextFlow.AddText(mode.NewValue.GetLocalisableDescription());
|
||||
TextFlow.Text = mode.NewValue.GetLocalisableDescription();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,18 +19,13 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
Pill.Background.Colour = colours.Pink;
|
||||
Pill.Background.Alpha = 1;
|
||||
TextFlow.Colour = Color4.Black;
|
||||
|
||||
Category.BindValueChanged(c =>
|
||||
{
|
||||
TextFlow.Clear();
|
||||
TextFlow.AddText(c.NewValue.GetLocalisableDescription());
|
||||
|
||||
var backgroundColour = colours.ForRoomCategory(Category.Value);
|
||||
if (backgroundColour != null)
|
||||
Pill.Background.Colour = backgroundColour.Value;
|
||||
TextFlow.Text = c.NewValue.GetLocalisableDescription();
|
||||
Pill.Background.Colour = colours.ForRoomCategory(c.NewValue) ?? colours.Pink;
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
|
@ -30,17 +30,15 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
FinishTransforms(true);
|
||||
|
||||
TextFlow.Colour = Colour4.Black;
|
||||
Pill.Background.Alpha = 1;
|
||||
}
|
||||
|
||||
private void updateDisplay()
|
||||
{
|
||||
RoomStatus status = getDisplayStatus();
|
||||
|
||||
Pill.Background.Alpha = 1;
|
||||
Pill.Background.FadeColour(status.GetAppropriateColour(colours), 100);
|
||||
|
||||
TextFlow.Clear();
|
||||
TextFlow.AddText(status.Message);
|
||||
TextFlow.Text = status.Message;
|
||||
}
|
||||
|
||||
private RoomStatus getDisplayStatus()
|
||||
|
Loading…
x
Reference in New Issue
Block a user