Icon and beatmap title visual pass

This commit is contained in:
Dean Herbert
2018-12-26 17:07:59 +09:00
parent c6c8c472bb
commit f442e59620
3 changed files with 13 additions and 7 deletions

View File

@ -13,10 +13,9 @@ namespace osu.Game.Online.Multiplayer.GameTypes
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Icon = FontAwesome.fa_clock_o, Icon = FontAwesome.fa_clock_o,
X = -2, // The icon is off-centre
Size = new Vector2(size), Size = new Vector2(size),
Colour = colours.Blue, Colour = colours.Blue,
Shadow = false Shadow = false
}; };
} }
} }

View File

@ -4,7 +4,7 @@ using osu.Framework.Graphics.Shapes;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Online.Multiplayer namespace osu.Game.Online.Multiplayer.GameTypes
{ {
public class VersusRow : FillFlowContainer public class VersusRow : FillFlowContainer
{ {

View File

@ -1,11 +1,13 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Online.Chat; using osu.Game.Online.Chat;
@ -23,14 +25,12 @@ namespace osu.Game.Screens.Multi.Components
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
InternalChild = textFlow = new LinkFlowContainer { AutoSizeAxes = Axes.Both }; InternalChild = textFlow = new LinkFlowContainer { AutoSizeAxes = Axes.Both };
Beatmap.BindValueChanged(v => updateText());
} }
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
updateText(); Beatmap.BindValueChanged(v => updateText(), true);
} }
private float textSize = OsuSpriteText.FONT_SIZE; private float textSize = OsuSpriteText.FONT_SIZE;
@ -48,6 +48,9 @@ namespace osu.Game.Screens.Multi.Components
} }
} }
[Resolved]
private OsuColour colours { get; set; }
private void updateText() private void updateText()
{ {
if (!IsLoaded) if (!IsLoaded)
@ -56,7 +59,11 @@ namespace osu.Game.Screens.Multi.Components
textFlow.Clear(); textFlow.Clear();
if (Beatmap.Value == null) if (Beatmap.Value == null)
textFlow.AddText("Changing map", s => s.TextSize = TextSize); textFlow.AddText("No beatmap selected", s =>
{
s.TextSize = TextSize;
s.Colour = colours.PinkLight;
});
else else
{ {
textFlow.AddLink(new[] textFlow.AddLink(new[]