Added new OsuLinkSpriteText.TextColour property that sets the internal content (OsuHoverContainer)'s colour instead of the whole container, so that text colour is always changed through that (e.g. link colouring, link hover fade).

Implemented it to be used when adding text to an OsuLinkTextFlowContainer.
This commit is contained in:
FreezyLemon
2017-12-04 13:33:42 +01:00
parent 319f43e209
commit cf96323980
3 changed files with 28 additions and 4 deletions

View File

@ -198,7 +198,7 @@ namespace osu.Game.Overlays.Chat
}
};
if (message.IsAction && senderHasBackground)
contentFlow.Colour = OsuColour.FromHex(message.Sender.Colour);
contentFlow.TextColour = OsuColour.FromHex(message.Sender.Colour);
updateMessageContent();
FinishTransforms(true);
@ -237,9 +237,7 @@ namespace osu.Game.Overlays.Chat
if (message.IsAction)
sprite.Font = @"Exo2.0-MediumItalic";
// TODO: Somehow check (if channel link) that this is a real channel
sprite.Colour = urlColour;
// We want to use something that is unique to every formatted link, so I just use the position of the link
// We want to use something that is unique to every formatted link PER MESSAGE
((ChatLinkSpriteText)sprite).LinkId = link.Index;
});
}