mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Update BeatmapInfoWedge design
- Adds colour difficulty strip. - Adjusts paddings. - Fixes source/artist confusion. - Double dash to em-dash.
This commit is contained in:
@ -3,31 +3,28 @@
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using System;
|
||||
|
||||
namespace osu.Game.Beatmaps.Drawables
|
||||
{
|
||||
internal class DifficultyIcon : Container
|
||||
{
|
||||
private readonly BeatmapInfo beatmap;
|
||||
private OsuColour palette;
|
||||
|
||||
public DifficultyIcon(BeatmapInfo beatmap)
|
||||
internal class DifficultyIcon : DifficultyColouredContainer
|
||||
{
|
||||
private BeatmapInfo beatmap;
|
||||
|
||||
public DifficultyIcon(BeatmapInfo beatmap) : base(beatmap)
|
||||
{
|
||||
this.beatmap = beatmap;
|
||||
const float size = 20;
|
||||
Size = new Vector2(size);
|
||||
Size = new Vector2(20);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour palette)
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
this.palette = palette;
|
||||
|
||||
Children = new[]
|
||||
{
|
||||
new TextAwesome
|
||||
@ -35,7 +32,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
TextSize = Size.X,
|
||||
Colour = getColour(beatmap),
|
||||
Colour = AccentColour,
|
||||
Icon = FontAwesome.fa_circle
|
||||
},
|
||||
new TextAwesome
|
||||
@ -48,43 +45,5 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private enum DifficultyRating
|
||||
{
|
||||
Easy,
|
||||
Normal,
|
||||
Hard,
|
||||
Insane,
|
||||
Expert
|
||||
}
|
||||
|
||||
private DifficultyRating getDifficultyRating(BeatmapInfo beatmap)
|
||||
{
|
||||
var rating = beatmap.StarDifficulty;
|
||||
|
||||
if (rating < 1.5) return DifficultyRating.Easy;
|
||||
if (rating < 2.25) return DifficultyRating.Normal;
|
||||
if (rating < 3.75) return DifficultyRating.Hard;
|
||||
if (rating < 5.25) return DifficultyRating.Insane;
|
||||
return DifficultyRating.Expert;
|
||||
}
|
||||
|
||||
private Color4 getColour(BeatmapInfo beatmap)
|
||||
{
|
||||
switch (getDifficultyRating(beatmap))
|
||||
{
|
||||
case DifficultyRating.Easy:
|
||||
return palette.Green;
|
||||
default:
|
||||
case DifficultyRating.Normal:
|
||||
return palette.Yellow;
|
||||
case DifficultyRating.Hard:
|
||||
return palette.Pink;
|
||||
case DifficultyRating.Insane:
|
||||
return palette.Purple;
|
||||
case DifficultyRating.Expert:
|
||||
return palette.Gray0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user