mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 22:06:08 +08:00
implement icons
This commit is contained in:
parent
881d58574e
commit
b78b40a629
@ -16,6 +16,7 @@ using osu.Framework.Graphics.Colour;
|
|||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Framework.Graphics.Textures;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
@ -25,6 +26,11 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private Container beatmapInfoContainer;
|
private Container beatmapInfoContainer;
|
||||||
|
|
||||||
|
private Texture time;
|
||||||
|
private Texture bpm;
|
||||||
|
private Texture hitCircles;
|
||||||
|
private Texture sliders;
|
||||||
|
|
||||||
private BaseGame game;
|
private BaseGame game;
|
||||||
|
|
||||||
public BeatmapInfoWedge()
|
public BeatmapInfoWedge()
|
||||||
@ -43,9 +49,13 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(BaseGame game)
|
private void load(BaseGame game, TextureStore textures)
|
||||||
{
|
{
|
||||||
this.game = game;
|
this.game = game;
|
||||||
|
time = textures.Get(@"BeatmapInfo/time");
|
||||||
|
bpm = textures.Get(@"BeatmapInfo/bpm");
|
||||||
|
hitCircles = textures.Get(@"BeatmapInfo/hitCircles");
|
||||||
|
sliders = textures.Get(@"BeatmapInfo/sliders");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateBeatmap(WorkingBeatmap beatmap)
|
public void UpdateBeatmap(WorkingBeatmap beatmap)
|
||||||
@ -84,7 +94,7 @@ namespace osu.Game.Screens.Select
|
|||||||
ColourInfo = ColourInfo.GradientVertical(Color4.White, new Color4(1f, 1f, 1f, 0.3f)),
|
ColourInfo = ColourInfo.GradientVertical(Color4.White, new Color4(1f, 1f, 1f, 0.3f)),
|
||||||
Children = new []
|
Children = new []
|
||||||
{
|
{
|
||||||
// Zoomed-in and cropped beatmap background
|
// Zoomed-in and cropped beatmap background
|
||||||
new BeatmapBackgroundSprite(beatmap)
|
new BeatmapBackgroundSprite(beatmap)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
@ -101,7 +111,7 @@ namespace osu.Game.Screens.Select
|
|||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirection.VerticalOnly,
|
||||||
Margin = new MarginPadding { Top = 10, Left = 25, Right = 10, Bottom = 20 },
|
Margin = new MarginPadding { Top = 10, Left = 25, Right = 10, Bottom = 20 },
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new SpriteText
|
new SpriteText
|
||||||
{
|
{
|
||||||
@ -140,87 +150,99 @@ namespace osu.Game.Screens.Select
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new FlowContainer
|
new Container
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Top = 20 },
|
Margin = new MarginPadding { Top = 20 },
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Spacing = new Vector2(4, 0),
|
Children = new Drawable[]
|
||||||
Children = new[]
|
{
|
||||||
{
|
new Container
|
||||||
new TextAwesome
|
{
|
||||||
{
|
AutoSizeAxes = Axes.Both,
|
||||||
Icon = FontAwesome.fa_clock_o,
|
Children = new[]
|
||||||
Colour = Color4.Yellow,
|
{
|
||||||
TextSize = 17,
|
new Sprite
|
||||||
Anchor = Anchor.BottomLeft,
|
{
|
||||||
Origin = Anchor.BottomLeft
|
Texture = time,
|
||||||
|
Scale = new Vector2(0.5f, 0.5f),
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
new SpriteText
|
new SpriteText
|
||||||
{
|
{
|
||||||
|
Margin = new MarginPadding { Left = 23, Bottom = 3 },
|
||||||
Font = @"Exo2.0-Bold",
|
Font = @"Exo2.0-Bold",
|
||||||
Colour = Color4.Yellow,
|
Colour = new Color4(255,221,85,255),
|
||||||
Text = ""+TimeSpan.FromMilliseconds((beatmap.Beatmap.HitObjects.Last().EndTime-beatmap.Beatmap.HitObjects.First().StartTime)).ToString(@"m\:s"),
|
Text = ""+TimeSpan.FromMilliseconds((beatmap.Beatmap.HitObjects.Last().EndTime-beatmap.Beatmap.HitObjects.First().StartTime)).ToString(@"m\:s"),
|
||||||
TextSize = 17,
|
|
||||||
Anchor = Anchor.BottomLeft,
|
|
||||||
Origin = Anchor.BottomLeft
|
|
||||||
},
|
|
||||||
new TextAwesome
|
|
||||||
{
|
|
||||||
Icon = FontAwesome.fa_music,
|
|
||||||
Colour = Color4.Yellow,
|
|
||||||
TextSize = 17,
|
TextSize = 17,
|
||||||
Anchor = Anchor.BottomLeft,
|
},
|
||||||
Origin = Anchor.BottomLeft
|
new Container
|
||||||
|
{
|
||||||
|
Margin = new MarginPadding { Left = 100 },
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new Sprite
|
||||||
|
{
|
||||||
|
Texture = bpm,
|
||||||
|
Scale = new Vector2(0.5f, 0.5f),
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
new SpriteText
|
new SpriteText
|
||||||
{
|
{
|
||||||
|
Margin = new MarginPadding { Left = 123, Bottom = 3 },
|
||||||
Font = @"Exo2.0-Bold",
|
Font = @"Exo2.0-Bold",
|
||||||
Colour = Color4.Yellow,
|
Colour = new Color4(255,221,85,255),
|
||||||
Text = ""+60000/beatmap.Beatmap.BeatLengthAt(beatmap.Beatmap.Metadata.PreviewTime)+" bpm",
|
Text = ""+60000/beatmap.Beatmap.BeatLengthAt(beatmap.Beatmap.Metadata.PreviewTime)+" bpm",
|
||||||
TextSize = 17,
|
|
||||||
Anchor = Anchor.BottomLeft,
|
|
||||||
Origin = Anchor.BottomLeft
|
|
||||||
},
|
|
||||||
new TextAwesome
|
|
||||||
{
|
|
||||||
Icon = FontAwesome.fa_dot_circle_o,
|
|
||||||
BorderColour = Color4.Purple,
|
|
||||||
Colour = Color4.Yellow,
|
|
||||||
TextSize = 17,
|
TextSize = 17,
|
||||||
Anchor = Anchor.BottomLeft,
|
},
|
||||||
Origin = Anchor.BottomLeft
|
new Container
|
||||||
|
{
|
||||||
|
Margin = new MarginPadding { Left = 200 },
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new Sprite
|
||||||
|
{
|
||||||
|
Texture = hitCircles,
|
||||||
|
Scale = new Vector2(0.5f, 0.5f),
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
new SpriteText
|
new SpriteText
|
||||||
{
|
{
|
||||||
|
Margin = new MarginPadding { Left = 223, Bottom = 3 },
|
||||||
Font = @"Exo2.0-Bold",
|
Font = @"Exo2.0-Bold",
|
||||||
Colour = Color4.Yellow,
|
Colour = new Color4(255,221,85,255),
|
||||||
Text = ""+beatmap.Beatmap.HitObjects.Count(b => b.GetType().ToString().Equals("osu.Game.Modes.Osu.Objects.HitCircle")),
|
Text = ""+beatmap.Beatmap.HitObjects.Count(b => b.GetType().ToString().Equals("osu.Game.Modes.Osu.Objects.HitCircle")),
|
||||||
TextSize = 17,
|
|
||||||
Anchor = Anchor.BottomLeft,
|
|
||||||
Origin = Anchor.BottomLeft
|
|
||||||
},
|
|
||||||
new TextAwesome
|
|
||||||
{
|
|
||||||
Icon = FontAwesome.fa_circle_o,
|
|
||||||
Colour = Color4.Yellow,
|
|
||||||
TextSize = 17,
|
TextSize = 17,
|
||||||
Anchor = Anchor.BottomLeft,
|
},
|
||||||
Origin = Anchor.BottomLeft
|
new Container
|
||||||
|
{
|
||||||
|
Margin = new MarginPadding { Left = 300 },
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new Sprite
|
||||||
|
{
|
||||||
|
Texture = sliders,
|
||||||
|
Scale = new Vector2(0.5f, 0.5f),
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
new SpriteText
|
new SpriteText
|
||||||
{
|
{
|
||||||
|
Margin = new MarginPadding { Left = 323, Bottom = 3 },
|
||||||
Font = @"Exo2.0-Bold",
|
Font = @"Exo2.0-Bold",
|
||||||
Colour = Color4.Yellow,
|
Colour = new Color4(255,221,85,255),
|
||||||
Text = ""+beatmap.Beatmap.HitObjects.Count(b => b.GetType().ToString().Equals("osu.Game.Modes.Osu.Objects.Slider")),
|
Text = ""+beatmap.Beatmap.HitObjects.Count(b => b.GetType().ToString().Equals("osu.Game.Modes.Osu.Objects.Slider")),
|
||||||
TextSize = 17,
|
TextSize = 17,
|
||||||
Anchor = Anchor.BottomLeft,
|
|
||||||
Origin = Anchor.BottomLeft
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}).Preload(game, delegate (Drawable d)
|
}).Preload(game, delegate (Drawable d)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user