mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 09:32:55 +08:00
Make sure tooltip appear in specific cases
This commit is contained in:
parent
1f2f26a503
commit
aa53f14329
@ -23,14 +23,14 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
{
|
{
|
||||||
private readonly RulesetInfo ruleset;
|
private readonly RulesetInfo ruleset;
|
||||||
|
|
||||||
public DifficultyIcon(BeatmapInfo beatmap, RulesetInfo ruleset = null)
|
public DifficultyIcon(BeatmapInfo beatmap, RulesetInfo ruleset = null, Boolean shouldShowTooltip = false)
|
||||||
: base(beatmap)
|
: base(beatmap)
|
||||||
{
|
{
|
||||||
if (beatmap == null)
|
if (beatmap == null)
|
||||||
throw new ArgumentNullException(nameof(beatmap));
|
throw new ArgumentNullException(nameof(beatmap));
|
||||||
|
|
||||||
this.ruleset = ruleset ?? beatmap.Ruleset;
|
this.ruleset = ruleset ?? beatmap.Ruleset;
|
||||||
TooltipText = $"{beatmap.Version}${beatmap.StarDifficulty.ToString("0.##")}";
|
TooltipText = shouldShowTooltip ? $"{beatmap.Version}${beatmap.StarDifficulty.ToString("0.##")}" : String.Empty;
|
||||||
|
|
||||||
Size = new Vector2(20);
|
Size = new Vector2(20);
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
starRating.Text = info[1];
|
starRating.Text = info[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Move(Vector2 pos) => this.Position = pos;
|
public void Move(Vector2 pos) => Position = pos;
|
||||||
|
|
||||||
protected override void PopIn() => this.FadeIn(200, Easing.OutQuint);
|
protected override void PopIn() => this.FadeIn(200, Easing.OutQuint);
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
var icons = new List<DifficultyIcon>();
|
var icons = new List<DifficultyIcon>();
|
||||||
|
|
||||||
foreach (var b in SetInfo.Beatmaps.OrderBy(beatmap => beatmap.StarDifficulty))
|
foreach (var b in SetInfo.Beatmaps.OrderBy(beatmap => beatmap.StarDifficulty))
|
||||||
icons.Add(new DifficultyIcon(b));
|
icons.Add(new DifficultyIcon(b, null, true));
|
||||||
|
|
||||||
return icons;
|
return icons;
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
if (item?.Beatmap != null)
|
if (item?.Beatmap != null)
|
||||||
{
|
{
|
||||||
drawableRuleset.FadeIn(transition_duration);
|
drawableRuleset.FadeIn(transition_duration);
|
||||||
drawableRuleset.Child = new DifficultyIcon(item.Beatmap, item.Ruleset) { Size = new Vector2(height) };
|
drawableRuleset.Child = new DifficultyIcon(item.Beatmap, item.Ruleset, true) { Size = new Vector2(height) };
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
drawableRuleset.FadeOut(transition_duration);
|
drawableRuleset.FadeOut(transition_duration);
|
||||||
|
Loading…
Reference in New Issue
Block a user