mirror of
https://github.com/ppy/osu
synced 2025-01-20 21:10:49 +00:00
initial wiki notice container
This commit is contained in:
parent
5c1c43dea3
commit
292f314fee
@ -1,6 +1,9 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using Markdig.Extensions.Yaml;
|
||||||
|
using Markdig.Syntax;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Containers.Markdown;
|
using osu.Game.Graphics.Containers.Markdown;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Wiki.Markdown
|
namespace osu.Game.Overlays.Wiki.Markdown
|
||||||
@ -11,5 +14,21 @@ namespace osu.Game.Overlays.Wiki.Markdown
|
|||||||
{
|
{
|
||||||
set => Schedule(() => DocumentUrl += $"wiki/{value}");
|
set => Schedule(() => DocumentUrl += $"wiki/{value}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void AddMarkdownComponent(IMarkdownObject markdownObject, FillFlowContainer container, int level)
|
||||||
|
{
|
||||||
|
switch (markdownObject)
|
||||||
|
{
|
||||||
|
case YamlFrontMatterBlock yamlFrontMatterBlock:
|
||||||
|
container.Add(CreateNotice(yamlFrontMatterBlock));
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
base.AddMarkdownComponent(markdownObject, container, level);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual FillFlowContainer CreateNotice(YamlFrontMatterBlock yamlFrontMatterBlock) => new WikiNoticeContainer(yamlFrontMatterBlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
19
osu.Game/Overlays/Wiki/Markdown/WikiNoticeContainer.cs
Normal file
19
osu.Game/Overlays/Wiki/Markdown/WikiNoticeContainer.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using Markdig.Extensions.Yaml;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.Wiki.Markdown
|
||||||
|
{
|
||||||
|
public class WikiNoticeContainer : FillFlowContainer
|
||||||
|
{
|
||||||
|
public WikiNoticeContainer(YamlFrontMatterBlock yamlFrontMatterBlock)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
Direction = FillDirection.Vertical;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user