1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 16:07:25 +08:00

Merge pull request #22843 from Joehuu/display-wiki-stub-notice

Display stub notice in marked wiki articles
This commit is contained in:
Dean Herbert 2023-03-12 19:06:30 +09:00 committed by GitHub
commit 20b2d0d4c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Resources.Localisation.Web;
using osuTK;
namespace osu.Game.Overlays.Wiki.Markdown
{
@ -19,24 +20,30 @@ namespace osu.Game.Overlays.Wiki.Markdown
{
private readonly bool isOutdated;
private readonly bool needsCleanup;
private readonly bool isStub;
public WikiNoticeContainer(YamlFrontMatterBlock yamlFrontMatterBlock)
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FillDirection.Vertical;
Spacing = new Vector2(10);
foreach (object line in yamlFrontMatterBlock.Lines)
{
switch (line.ToString())
{
case "outdated: true":
case @"outdated: true":
isOutdated = true;
break;
case "needs_cleanup: true":
case @"needs_cleanup: true":
needsCleanup = true;
break;
case @"stub: true":
isStub = true;
break;
}
}
}
@ -60,6 +67,14 @@ namespace osu.Game.Overlays.Wiki.Markdown
Text = WikiStrings.ShowNeedsCleanupOrRewrite,
});
}
if (isStub)
{
Add(new NoticeBox
{
Text = WikiStrings.ShowStub,
});
}
}
private partial class NoticeBox : Container