mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 02:32:55 +08:00
Update and add missing beatmap statistic icons to info wedge
This commit is contained in:
parent
19de6124b6
commit
72cb65c22f
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
|
|
||||||
@ -23,19 +22,19 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
|||||||
{
|
{
|
||||||
Name = @"Fruit Count",
|
Name = @"Fruit Count",
|
||||||
Content = fruits.ToString(),
|
Content = fruits.ToString(),
|
||||||
Icon = FontAwesome.Regular.Circle
|
CreateIcon = () => new BeatmapStatisticSprite("circles"),
|
||||||
},
|
},
|
||||||
new BeatmapStatistic
|
new BeatmapStatistic
|
||||||
{
|
{
|
||||||
Name = @"Juice Stream Count",
|
Name = @"Juice Stream Count",
|
||||||
Content = juiceStreams.ToString(),
|
Content = juiceStreams.ToString(),
|
||||||
Icon = FontAwesome.Regular.Circle
|
CreateIcon = () => new BeatmapStatisticSprite("sliders"),
|
||||||
},
|
},
|
||||||
new BeatmapStatistic
|
new BeatmapStatistic
|
||||||
{
|
{
|
||||||
Name = @"Banana Shower Count",
|
Name = @"Banana Shower Count",
|
||||||
Content = bananaShowers.ToString(),
|
Content = bananaShowers.ToString(),
|
||||||
Icon = FontAwesome.Regular.Circle
|
CreateIcon = () => new BeatmapStatisticSprite("spinners"),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mania.Objects;
|
using osu.Game.Rulesets.Mania.Objects;
|
||||||
using osu.Game.Rulesets.Mania.UI;
|
using osu.Game.Rulesets.Mania.UI;
|
||||||
@ -41,14 +40,14 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
|
|||||||
new BeatmapStatistic
|
new BeatmapStatistic
|
||||||
{
|
{
|
||||||
Name = @"Note Count",
|
Name = @"Note Count",
|
||||||
|
CreateIcon = () => new BeatmapStatisticSprite("circles"),
|
||||||
Content = notes.ToString(),
|
Content = notes.ToString(),
|
||||||
Icon = FontAwesome.Regular.Circle
|
|
||||||
},
|
},
|
||||||
new BeatmapStatistic
|
new BeatmapStatistic
|
||||||
{
|
{
|
||||||
Name = @"Hold Note Count",
|
Name = @"Hold Note Count",
|
||||||
|
CreateIcon = () => new BeatmapStatisticSprite("sliders"),
|
||||||
Content = holdnotes.ToString(),
|
Content = holdnotes.ToString(),
|
||||||
Icon = FontAwesome.Regular.Circle
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
|
|
||||||
@ -23,19 +22,19 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
{
|
{
|
||||||
Name = @"Circle Count",
|
Name = @"Circle Count",
|
||||||
Content = circles.ToString(),
|
Content = circles.ToString(),
|
||||||
Icon = FontAwesome.Regular.Circle
|
CreateIcon = () => new BeatmapStatisticSprite("circles"),
|
||||||
},
|
},
|
||||||
new BeatmapStatistic
|
new BeatmapStatistic
|
||||||
{
|
{
|
||||||
Name = @"Slider Count",
|
Name = @"Slider Count",
|
||||||
Content = sliders.ToString(),
|
Content = sliders.ToString(),
|
||||||
Icon = FontAwesome.Regular.Circle
|
CreateIcon = () => new BeatmapStatisticSprite("sliders"),
|
||||||
},
|
},
|
||||||
new BeatmapStatistic
|
new BeatmapStatistic
|
||||||
{
|
{
|
||||||
Name = @"Spinner Count",
|
Name = @"Spinner Count",
|
||||||
Content = spinners.ToString(),
|
Content = spinners.ToString(),
|
||||||
Icon = FontAwesome.Regular.Circle
|
CreateIcon = () => new BeatmapStatisticSprite("spinners"),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Taiko.Objects;
|
using osu.Game.Rulesets.Taiko.Objects;
|
||||||
|
|
||||||
@ -22,20 +21,20 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
|||||||
new BeatmapStatistic
|
new BeatmapStatistic
|
||||||
{
|
{
|
||||||
Name = @"Hit Count",
|
Name = @"Hit Count",
|
||||||
|
CreateIcon = () => new BeatmapStatisticSprite("circles"),
|
||||||
Content = hits.ToString(),
|
Content = hits.ToString(),
|
||||||
Icon = FontAwesome.Regular.Circle
|
|
||||||
},
|
},
|
||||||
new BeatmapStatistic
|
new BeatmapStatistic
|
||||||
{
|
{
|
||||||
Name = @"Drumroll Count",
|
Name = @"Drumroll Count",
|
||||||
|
CreateIcon = () => new BeatmapStatisticSprite("sliders"),
|
||||||
Content = drumrolls.ToString(),
|
Content = drumrolls.ToString(),
|
||||||
Icon = FontAwesome.Regular.Circle
|
|
||||||
},
|
},
|
||||||
new BeatmapStatistic
|
new BeatmapStatistic
|
||||||
{
|
{
|
||||||
Name = @"Swell Count",
|
Name = @"Swell Count",
|
||||||
|
CreateIcon = () => new BeatmapStatisticSprite("spinners"),
|
||||||
Content = swells.ToString(),
|
Content = swells.ToString(),
|
||||||
Icon = FontAwesome.Regular.Circle
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,30 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps
|
namespace osu.Game.Beatmaps
|
||||||
{
|
{
|
||||||
public class BeatmapStatistic
|
public class BeatmapStatistic
|
||||||
{
|
{
|
||||||
public IconUsage Icon;
|
[Obsolete("Use CreateIcon instead")] // can be removed 20210203
|
||||||
|
public IconUsage Icon = FontAwesome.Regular.QuestionCircle;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A function to create the icon for display purposes.
|
||||||
|
/// </summary>
|
||||||
|
public Func<Drawable> CreateIcon;
|
||||||
|
|
||||||
public string Content;
|
public string Content;
|
||||||
public string Name;
|
public string Name;
|
||||||
|
|
||||||
|
public BeatmapStatistic()
|
||||||
|
{
|
||||||
|
#pragma warning disable 618
|
||||||
|
CreateIcon = () => new SpriteIcon { Icon = Icon };
|
||||||
|
#pragma warning restore 618
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
25
osu.Game/Beatmaps/BeatmapStatisticSprite.cs
Normal file
25
osu.Game/Beatmaps/BeatmapStatisticSprite.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Graphics.Textures;
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps
|
||||||
|
{
|
||||||
|
public class BeatmapStatisticSprite : Sprite
|
||||||
|
{
|
||||||
|
private readonly string iconName;
|
||||||
|
|
||||||
|
public BeatmapStatisticSprite(string iconName)
|
||||||
|
{
|
||||||
|
this.iconName = iconName;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(TextureStore textures)
|
||||||
|
{
|
||||||
|
Texture = textures.Get($"Icons/BeatmapDetails/{iconName}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -318,14 +318,14 @@ namespace osu.Game.Screens.Select
|
|||||||
labels.Add(new InfoLabel(new BeatmapStatistic
|
labels.Add(new InfoLabel(new BeatmapStatistic
|
||||||
{
|
{
|
||||||
Name = "Length",
|
Name = "Length",
|
||||||
Icon = FontAwesome.Regular.Clock,
|
CreateIcon = () => new BeatmapStatisticSprite("length"),
|
||||||
Content = TimeSpan.FromMilliseconds(b.BeatmapInfo.Length).ToString(@"m\:ss"),
|
Content = TimeSpan.FromMilliseconds(b.BeatmapInfo.Length).ToString(@"m\:ss"),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
labels.Add(new InfoLabel(new BeatmapStatistic
|
labels.Add(new InfoLabel(new BeatmapStatistic
|
||||||
{
|
{
|
||||||
Name = "BPM",
|
Name = "BPM",
|
||||||
Icon = FontAwesome.Regular.Circle,
|
CreateIcon = () => new BeatmapStatisticSprite("bpm"),
|
||||||
Content = getBPMRange(b),
|
Content = getBPMRange(b),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -418,10 +418,18 @@ namespace osu.Game.Screens.Select
|
|||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Scale = new Vector2(0.8f),
|
|
||||||
Colour = Color4Extensions.FromHex(@"f7dd55"),
|
Colour = Color4Extensions.FromHex(@"f7dd55"),
|
||||||
Icon = statistic.Icon,
|
Icon = FontAwesome.Regular.Circle,
|
||||||
|
Scale = new Vector2(0.8f)
|
||||||
},
|
},
|
||||||
|
statistic.CreateIcon().With(i =>
|
||||||
|
{
|
||||||
|
i.Anchor = Anchor.Centre;
|
||||||
|
i.Origin = Anchor.Centre;
|
||||||
|
i.RelativeSizeAxes = Axes.Both;
|
||||||
|
i.Size = new Vector2(1.2f);
|
||||||
|
i.Colour = Color4Extensions.FromHex(@"f7dd55");
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
|
Loading…
Reference in New Issue
Block a user