mirror of
https://github.com/ppy/osu
synced 2025-01-25 07:13:22 +00: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()
|
private void updateDisplay()
|
||||||
{
|
{
|
||||||
RoomStatus status = EndDate.Value < DateTimeOffset.Now ? new RoomStatusEnded() : Status.Value ?? new RoomStatusOpen();
|
RoomStatus status = getDisplayStatus();
|
||||||
|
|
||||||
pill.Background.Alpha = 1;
|
pill.Background.Alpha = 1;
|
||||||
pill.Background.FadeColour(status.GetAppropriateColour(colours), firstDisplay ? 0 : 100);
|
pill.Background.FadeColour(status.GetAppropriateColour(colours), firstDisplay ? 0 : 100);
|
||||||
@ -63,5 +63,13 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
|||||||
|
|
||||||
firstDisplay = false;
|
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