1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

use inline code in markdown text flow

This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-06-01 14:03:57 +07:00
parent 1babb05fc7
commit 5108dadfbc
No known key found for this signature in database
GPG Key ID: 25F6F17FD29031E2

View File

@ -14,15 +14,14 @@ namespace osu.Game.Graphics.Containers.Markdown
{
public class OsuMarkdownTextFlowContainer : MarkdownTextFlowContainer
{
[Resolved]
private OverlayColourProvider colourProvider { get; set; }
protected override void AddLinkText(string text, LinkInline linkInline)
=> AddDrawable(new OsuMarkdownLinkText(text, linkInline));
// TODO : Add background (colour B6) and change font to monospace
protected override void AddCodeInLine(CodeInline codeInline)
=> AddText(codeInline.Content, t => { t.Colour = colourProvider.Light1; });
// TODO : Change font to monospace
protected override void AddCodeInLine(CodeInline codeInline) => AddDrawable(new OsuMarkdownInlineCode
{
Text = codeInline.Content
});
protected override SpriteText CreateEmphasisedSpriteText(bool bold, bool italic)
=> CreateSpriteText().With(t => t.Font = t.Font.With(weight: bold ? FontWeight.Bold : FontWeight.Regular, italics: italic));