add order in OsuMarkdownListItem for ordered list

This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-04-30 10:47:51 +07:00
parent 1582b0da88
commit 2a3479f30d
No known key found for this signature in database
GPG Key ID: 25F6F17FD29031E2
2 changed files with 6 additions and 2 deletions

View File

@ -50,7 +50,7 @@ namespace osu.Game.Graphics.Containers.Markdown
Padding = new MarginPadding(0)
};
protected virtual OsuMarkdownListItem CreateListItem(ListItemBlock listItemBlock, int level) => new OsuMarkdownListItem(level);
protected virtual OsuMarkdownListItem CreateListItem(ListItemBlock listItemBlock, int level) => new OsuMarkdownListItem(level, listItemBlock.Order);
protected override MarkdownPipeline CreateBuilder()
=> new MarkdownPipelineBuilder().UseAutoIdentifiers(AutoIdentifierOptions.GitHub)

View File

@ -12,6 +12,8 @@ namespace osu.Game.Graphics.Containers.Markdown
public class OsuMarkdownListItem : CompositeDrawable
{
private readonly int level;
private readonly int order;
private readonly bool isOrdered;
private const float default_left_padding = 20;
[Resolved]
@ -19,9 +21,11 @@ namespace osu.Game.Graphics.Containers.Markdown
public FillFlowContainer Content { get; }
public OsuMarkdownListItem(int level)
public OsuMarkdownListItem(int level, int order)
{
this.level = level;
this.order = order;
isOrdered = order != 0;
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;