mirror of
https://github.com/ppy/osu.git
synced 2026-05-20 01:19:52 +08:00
Use switch statement class type matching
This commit is contained in:
@@ -187,7 +187,19 @@ namespace osu.Game.Overlays.Dashboard
|
||||
|
||||
// TODO: we probably don't want to do this every frame.
|
||||
var activity = metadataClient?.GetPresence(User.Id)?.Activity;
|
||||
spectateButton.Enabled.Value = activity is UserActivity.InSoloGame or UserActivity.InMultiplayerGame or UserActivity.InPlaylistGame;
|
||||
|
||||
switch (activity)
|
||||
{
|
||||
default:
|
||||
spectateButton.Enabled.Value = false;
|
||||
break;
|
||||
|
||||
case UserActivity.InSoloGame:
|
||||
case UserActivity.InMultiplayerGame:
|
||||
case UserActivity.InPlaylistGame:
|
||||
spectateButton.Enabled.Value = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
||||
Reference in New Issue
Block a user