1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-11 10:03:22 +08:00
osu-lazer/osu.Game/Screens/OnlinePlay/Lounge/Components/QueueModePill.cs

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

43 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.
2024-11-13 17:57:51 +08:00
using System.ComponentModel;
using osu.Framework.Extensions;
2024-11-13 17:57:51 +08:00
using osu.Game.Online.Rooms;
namespace osu.Game.Screens.OnlinePlay.Lounge.Components
{
public partial class QueueModePill : OnlinePlayPill
{
2024-11-13 17:57:51 +08:00
private readonly Room room;
public QueueModePill(Room room)
{
this.room = room;
}
protected override void LoadComplete()
{
base.LoadComplete();
2024-11-13 17:57:51 +08:00
room.PropertyChanged += onRoomPropertyChanged;
updateRoomQueueMode();
}
2024-11-13 17:57:51 +08:00
private void onRoomPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(Room.QueueMode))
updateRoomQueueMode();
}
private void updateRoomQueueMode()
=> TextFlow.Text = room.QueueMode.GetLocalisableDescription();
protected override void Dispose(bool isDisposing)
{
2024-11-13 17:57:51 +08:00
base.Dispose(isDisposing);
room.PropertyChanged -= onRoomPropertyChanged;
}
}
}