mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +08:00
Use an if statement instead of a switch
This commit is contained in:
parent
cc55690c00
commit
446210b812
@ -77,28 +77,10 @@ namespace osu.Desktop
|
|||||||
|
|
||||||
private void setPresenceGamemode(RulesetInfo ruleset, RichPresence presence)
|
private void setPresenceGamemode(RulesetInfo ruleset, RichPresence presence)
|
||||||
{
|
{
|
||||||
switch (ruleset.ID)
|
if (ruleset.ID != null && ruleset.ID <= 3) //legacy rulesets use an ID between 0 and 3
|
||||||
{
|
presence.Assets.SmallImageKey = ruleset.ShortName;
|
||||||
case 0:
|
else
|
||||||
presence.Assets.SmallImageKey = ruleset.ShortName;
|
presence.Assets.SmallImageKey = "unknown"; //not a legay ruleset so let's display the unknown ruleset icon.
|
||||||
break;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
presence.Assets.SmallImageKey = ruleset.ShortName;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
presence.Assets.SmallImageKey = ruleset.ShortName;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
presence.Assets.SmallImageKey = ruleset.ShortName;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
presence.Assets.SmallImageKey = "unknown";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
presence.Assets.SmallImageText = ruleset.ShortName;
|
presence.Assets.SmallImageText = ruleset.ShortName;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user