Removed LinkId and word wrapping (for now).

Also reimplemented the OsuHoverContainer properly
This commit is contained in:
FreezyLemon
2017-12-25 20:46:04 +01:00
parent 025d3941a2
commit 962e4d7c8a
5 changed files with 26 additions and 97 deletions

View File

@ -11,6 +11,7 @@ namespace osu.Game.Graphics.Containers
public class OsuHoverContainer : OsuClickableContainer
{
private Color4 hoverColour;
private Color4 unhoverColour;
protected override bool OnHover(InputState state)
{
@ -20,7 +21,7 @@ namespace osu.Game.Graphics.Containers
protected override void OnHoverLost(InputState state)
{
this.FadeColour(Color4.White, 500, Easing.OutQuint);
this.FadeColour(unhoverColour, 500, Easing.OutQuint);
base.OnHoverLost(state);
}
@ -28,6 +29,7 @@ namespace osu.Game.Graphics.Containers
private void load(OsuColour colours)
{
hoverColour = colours.Yellow;
unhoverColour = Colour;
}
}
}

View File

@ -36,6 +36,9 @@ namespace osu.Game.Graphics.Containers
public void AddLink(string text, string url, Action<SpriteText> creationParameters = null)
{
// TODO: Remove this and get word wrapping working
text = text.Replace(' ', '_');
AddText(text, link =>
{
creationParameters?.Invoke(link);