1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 14:13:20 +08:00

Remove unnecessary null check and tweak transform a bit.

This commit is contained in:
Unknown 2017-11-26 11:19:42 +05:30
parent ae9ce2f122
commit f4f732ca43
2 changed files with 18 additions and 21 deletions

View File

@ -70,27 +70,24 @@ namespace osu.Game.Online.API.Requests
break;
}
if (ruleset != null)
switch (ruleset?.Name)
{
switch (ruleset.Name)
{
default:
case @"osu!":
req.AddParameter(@"mode", @"osu");
break;
default:
case @"osu!":
req.AddParameter(@"mode", @"osu");
break;
case @"osu!taiko":
req.AddParameter(@"mode", @"taiko");
break;
case @"osu!taiko":
req.AddParameter(@"mode", @"taiko");
break;
case @"osu!catch":
req.AddParameter(@"mode", @"catch");
break;
case @"osu!catch":
req.AddParameter(@"mode", @"catch");
break;
case @"osu!mania":
req.AddParameter(@"mode", @"mania");
break;
}
case @"osu!mania":
req.AddParameter(@"mode", @"mania");
break;
}
return req;

View File

@ -232,6 +232,8 @@ namespace osu.Game.Screens.Select.Leaderboards
if (api == null || Beatmap?.OnlineBeatmapID == null) return;
loading.Show();
if (Scope == LeaderboardScope.Local)
{
// TODO: get local scores from wherever here.
@ -239,8 +241,6 @@ namespace osu.Game.Screens.Select.Leaderboards
return;
}
loading.Show();
getScoresRequest = new GetScoresRequest(Beatmap, osuGame?.Ruleset.Value, Scope);
getScoresRequest.Success += r =>
{
@ -323,13 +323,13 @@ namespace osu.Game.Screens.Select.Leaderboards
protected override bool OnMouseDown(Framework.Input.InputState state, Framework.Input.MouseDownEventArgs args)
{
icon.ScaleTo(0.8f, 200, Easing.InElastic);
icon.ScaleTo(0.8f, 800, Easing.InElastic);
return base.OnMouseDown(state, args);
}
protected override bool OnMouseUp(Framework.Input.InputState state, Framework.Input.MouseUpEventArgs args)
{
icon.ScaleTo(1.2f, 400, Easing.OutElastic).Then().ScaleTo(1f, 400, Easing.OutElastic);
icon.ScaleTo(1.2f, 800, Easing.OutElastic).Then().ScaleTo(1f, 800, Easing.OutElastic);
return base.OnMouseUp(state, args);
}
}