mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 23:23:04 +08:00
Split status retrieval into its own method
This commit is contained in:
parent
7cb743a734
commit
a12f6b78a4
@ -55,7 +55,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
|
||||
private void updateDisplay()
|
||||
{
|
||||
RoomStatus status = EndDate.Value < DateTimeOffset.Now ? new RoomStatusEnded() : Status.Value ?? new RoomStatusOpen();
|
||||
RoomStatus status = getDisplayStatus();
|
||||
|
||||
pill.Background.Alpha = 1;
|
||||
pill.Background.FadeColour(status.GetAppropriateColour(colours), firstDisplay ? 0 : 100);
|
||||
@ -63,5 +63,13 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
|
||||
firstDisplay = false;
|
||||
}
|
||||
|
||||
private RoomStatus getDisplayStatus()
|
||||
{
|
||||
if (EndDate.Value < DateTimeOffset.Now)
|
||||
return new RoomStatusEnded();
|
||||
|
||||
return Status.Value ?? new RoomStatusOpen();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user