mirror of
https://github.com/ppy/osu
synced 2025-03-05 19:11:52 +00:00
Merge branch 'markdown-link' into markdown-wiki
This commit is contained in:
commit
02f0e2f212
@ -23,10 +23,14 @@ namespace osu.Game.Graphics.Containers.Markdown
|
||||
LineSpacing = 21;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(IAPIProvider api)
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||
{
|
||||
var api = parent.Get<IAPIProvider>();
|
||||
|
||||
// needs to be set before the base BDL call executes to avoid invalidating any already populated markdown content.
|
||||
DocumentUrl = api.WebsiteRootUrl;
|
||||
|
||||
return base.CreateChildDependencies(parent);
|
||||
}
|
||||
|
||||
protected override void AddMarkdownComponent(IMarkdownObject markdownObject, FillFlowContainer container, int level)
|
||||
|
@ -16,28 +16,29 @@ namespace osu.Game.Graphics.Containers.Markdown
|
||||
[Resolved(canBeNull: true)]
|
||||
private OsuGame game { get; set; }
|
||||
|
||||
protected string Text;
|
||||
protected string Title;
|
||||
private readonly string text;
|
||||
private readonly string title;
|
||||
|
||||
public OsuMarkdownLinkText(string text, LinkInline linkInline)
|
||||
: base(text, linkInline)
|
||||
{
|
||||
Text = text;
|
||||
Title = linkInline.Title;
|
||||
this.text = text;
|
||||
title = linkInline.Title;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
private void load()
|
||||
{
|
||||
var text = CreateSpriteText().With(t => t.Text = Text);
|
||||
var textDrawable = CreateSpriteText().With(t => t.Text = text);
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
text,
|
||||
new OsuMarkdownLinkCompiler(new[] { text })
|
||||
textDrawable,
|
||||
new OsuMarkdownLinkCompiler(new[] { textDrawable })
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Action = OnLinkPressed,
|
||||
TooltipText = Title ?? Url,
|
||||
TooltipText = title ?? Url,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user