mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Mapper -> Author, use BeatmapSetInfo for metadata
This commit is contained in:
@ -8,6 +8,7 @@ using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
|
||||
@ -19,20 +20,20 @@ namespace osu.Game.Overlays.Direct
|
||||
private readonly float vertical_padding = 5;
|
||||
|
||||
private readonly Sprite background;
|
||||
private readonly OsuSpriteText title, artist, mapperPrefix, mapper, source;
|
||||
private readonly OsuSpriteText title, artist, authorPrefix, author, source;
|
||||
private readonly Statistic playCount, favouriteCount;
|
||||
private readonly FillFlowContainer difficultyIcons;
|
||||
|
||||
protected override Sprite Background => background;
|
||||
protected override OsuSpriteText Title => title;
|
||||
protected override OsuSpriteText Artist => artist;
|
||||
protected override OsuSpriteText Mapper => mapper;
|
||||
protected override OsuSpriteText Author => author;
|
||||
protected override OsuSpriteText Source => source;
|
||||
protected override Statistic PlayCount => playCount;
|
||||
protected override Statistic FavouriteCount => favouriteCount;
|
||||
protected override FillFlowContainer DifficultyIcons => difficultyIcons;
|
||||
|
||||
public DirectGridPanel()
|
||||
public DirectGridPanel(BeatmapSetInfo beatmap) : base(beatmap)
|
||||
{
|
||||
Height = 140 + vertical_padding; //full height of all the elements plus vertical padding (autosize uses the image)
|
||||
CornerRadius = 4;
|
||||
@ -113,13 +114,13 @@ namespace osu.Game.Overlays.Direct
|
||||
Direction = FillDirection.Horizontal,
|
||||
Children = new[]
|
||||
{
|
||||
mapperPrefix = new OsuSpriteText
|
||||
authorPrefix = new OsuSpriteText
|
||||
{
|
||||
Text = @"mapped by ",
|
||||
TextSize = 14,
|
||||
Shadow = false,
|
||||
},
|
||||
mapper = new OsuSpriteText
|
||||
author = new OsuSpriteText
|
||||
{
|
||||
TextSize = 14,
|
||||
Font = @"Exo2.0-SemiBoldItalic",
|
||||
@ -165,8 +166,8 @@ namespace osu.Game.Overlays.Direct
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
mapperPrefix.Colour = colours.Gray5;
|
||||
Mapper.Colour = colours.BlueDark;
|
||||
authorPrefix.Colour = colours.Gray5;
|
||||
Author.Colour = colours.BlueDark;
|
||||
Source.Colour = colours.Gray5;
|
||||
}
|
||||
}
|
||||
|
@ -11,30 +11,31 @@ using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Database;
|
||||
|
||||
namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
public class DirectListPanel : DirectPanel
|
||||
{
|
||||
private readonly float horizontal_padding = 10;
|
||||
private readonly float horizontal_padding = 10;
|
||||
private readonly float vertical_padding = 5;
|
||||
private readonly float height = 70;
|
||||
|
||||
private readonly Sprite background;
|
||||
private readonly OsuSpriteText title, artist, mapper, source;
|
||||
private readonly OsuSpriteText title, artist, author, source;
|
||||
private readonly Statistic playCount, favouriteCount;
|
||||
private readonly FillFlowContainer difficultyIcons;
|
||||
|
||||
protected override Sprite Background => background;
|
||||
protected override OsuSpriteText Title => title;
|
||||
protected override OsuSpriteText Artist => artist;
|
||||
protected override OsuSpriteText Mapper => mapper;
|
||||
protected override OsuSpriteText Author => author;
|
||||
protected override OsuSpriteText Source => source;
|
||||
protected override Statistic PlayCount => playCount;
|
||||
protected override Statistic FavouriteCount => favouriteCount;
|
||||
protected override FillFlowContainer DifficultyIcons => difficultyIcons;
|
||||
|
||||
public DirectListPanel()
|
||||
public DirectListPanel(BeatmapSetInfo beatmap) : base(beatmap)
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = height;
|
||||
@ -101,11 +102,11 @@ namespace osu.Game.Overlays.Direct
|
||||
Margin = new MarginPadding { Right = (height - vertical_padding * 2) + vertical_padding },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
playCount = new Statistic(FontAwesome.fa_play_circle, 4579492)
|
||||
{
|
||||
playCount = new Statistic(FontAwesome.fa_play_circle)
|
||||
{
|
||||
Margin = new MarginPadding { Right = 1 },
|
||||
},
|
||||
favouriteCount = new Statistic(FontAwesome.fa_heart, 2659),
|
||||
favouriteCount = new Statistic(FontAwesome.fa_heart),
|
||||
new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
@ -119,7 +120,7 @@ namespace osu.Game.Overlays.Direct
|
||||
Text = @"mapped by ",
|
||||
TextSize = 14,
|
||||
},
|
||||
mapper = new OsuSpriteText
|
||||
author = new OsuSpriteText
|
||||
{
|
||||
TextSize = 14,
|
||||
Font = @"Exo2.0-SemiBoldItalic",
|
||||
|
@ -6,7 +6,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
@ -19,28 +19,29 @@ namespace osu.Game.Overlays.Direct
|
||||
protected virtual Sprite Background { get; }
|
||||
protected virtual OsuSpriteText Title { get; }
|
||||
protected virtual OsuSpriteText Artist { get; }
|
||||
protected virtual OsuSpriteText Mapper { get; }
|
||||
protected virtual OsuSpriteText Author { get; }
|
||||
protected virtual OsuSpriteText Source { get; }
|
||||
protected virtual Statistic PlayCount { get; }
|
||||
protected virtual Statistic FavouriteCount { get; }
|
||||
protected virtual FillFlowContainer DifficultyIcons { get; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures, RulesetDatabase rulesets)
|
||||
private BeatmapSetInfo setInfo;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(LocalisationEngine localisation)
|
||||
{
|
||||
Title.Current = localisation.GetUnicodePreference(setInfo.Metadata.TitleUnicode, setInfo.Metadata.Title);
|
||||
Artist.Current = localisation.GetUnicodePreference(setInfo.Metadata.ArtistUnicode, setInfo.Metadata.Artist);
|
||||
Author.Text = setInfo.Metadata.Author;
|
||||
Source.Text = @"from " + setInfo.Metadata.Source;
|
||||
|
||||
foreach (var b in setInfo.Beatmaps)
|
||||
DifficultyIcons.Add(new DifficultyIcon(b));
|
||||
}
|
||||
|
||||
public DirectPanel(BeatmapSetInfo setInfo)
|
||||
{
|
||||
Background.Texture = textures.Get(@"Backgrounds/bg4");
|
||||
|
||||
Title.Text = @"Platina";
|
||||
Artist.Text = @"Maaya Sakamoto";
|
||||
Mapper.Text = @"TicClick";
|
||||
Source.Text = @"from Cardcaptor Sakura";
|
||||
PlayCount.Value = 4579492;
|
||||
FavouriteCount.Value = 2659;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
DifficultyIcons.Add(new DifficultyIcon(new BeatmapInfo { Ruleset = rulesets.GetRuleset(i), StarDifficulty = i + 1 }));
|
||||
}
|
||||
this.setInfo = setInfo;
|
||||
}
|
||||
|
||||
public class Statistic : FillFlowContainer
|
||||
|
Reference in New Issue
Block a user