mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Icon and beatmap title visual pass
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.Chat;
|
||||
@ -23,14 +25,12 @@ namespace osu.Game.Screens.Multi.Components
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
InternalChild = textFlow = new LinkFlowContainer { AutoSizeAxes = Axes.Both };
|
||||
|
||||
Beatmap.BindValueChanged(v => updateText());
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
updateText();
|
||||
Beatmap.BindValueChanged(v => updateText(), true);
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
if (!IsLoaded)
|
||||
@ -56,7 +59,11 @@ namespace osu.Game.Screens.Multi.Components
|
||||
textFlow.Clear();
|
||||
|
||||
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
|
||||
{
|
||||
textFlow.AddLink(new[]
|
||||
|
Reference in New Issue
Block a user