mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:32:55 +08:00
Move converted beatmap icons logic locally
This commit is contained in:
parent
b733f46c6f
commit
ae49e724e4
@ -13,7 +13,6 @@ using osu.Framework.Graphics.Sprites;
|
|||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
@ -117,9 +116,6 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
|
|
||||||
private Drawable getRulesetIcon()
|
private Drawable getRulesetIcon()
|
||||||
{
|
{
|
||||||
if ((beatmap as APIBeatmap)?.Convert == true)
|
|
||||||
return rulesets.GetRuleset(0)!.CreateInstance().CreateIcon();
|
|
||||||
|
|
||||||
int? onlineID = ruleset.OnlineID;
|
int? onlineID = ruleset.OnlineID;
|
||||||
|
|
||||||
if (onlineID >= 0 && rulesets.GetRuleset(onlineID.Value)?.CreateInstance() is Ruleset rulesetInstance)
|
if (onlineID >= 0 && rulesets.GetRuleset(onlineID.Value)?.CreateInstance() is Ruleset rulesetInstance)
|
||||||
|
@ -170,7 +170,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
.Where(b => b.Ruleset.MatchesOnlineID(ruleset.Value))
|
.Where(b => b.Ruleset.MatchesOnlineID(ruleset.Value))
|
||||||
.OrderBy(b => !b.Convert)
|
.OrderBy(b => !b.Convert)
|
||||||
.ThenBy(b => b.StarRating)
|
.ThenBy(b => b.StarRating)
|
||||||
.Select(b => new DifficultySelectorButton(b)
|
.Select(b => new DifficultySelectorButton(b, b.Convert ? new RulesetInfo { OnlineID = 0 } : null)
|
||||||
{
|
{
|
||||||
State = DifficultySelectorState.NotSelected,
|
State = DifficultySelectorState.NotSelected,
|
||||||
OnHovered = beatmap =>
|
OnHovered = beatmap =>
|
||||||
@ -254,7 +254,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DifficultySelectorButton(APIBeatmap beatmapInfo)
|
public DifficultySelectorButton(APIBeatmap beatmapInfo, IRulesetInfo? ruleset)
|
||||||
{
|
{
|
||||||
Beatmap = beatmapInfo;
|
Beatmap = beatmapInfo;
|
||||||
Size = new Vector2(size);
|
Size = new Vector2(size);
|
||||||
@ -273,7 +273,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
Alpha = 0.5f
|
Alpha = 0.5f
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
icon = new DifficultyIcon(beatmapInfo)
|
icon = new DifficultyIcon(beatmapInfo, ruleset)
|
||||||
{
|
{
|
||||||
ShowTooltip = false,
|
ShowTooltip = false,
|
||||||
Current = { Value = new StarDifficulty(beatmapInfo.StarRating, 0) },
|
Current = { Value = new StarDifficulty(beatmapInfo.StarRating, 0) },
|
||||||
|
Loading…
Reference in New Issue
Block a user