mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 20:13:22 +08:00
Move text and isFullWidth
parameters to constructor
This commit is contained in:
parent
a7865d3f22
commit
d66f07fccb
@ -77,10 +77,8 @@ namespace osu.Game.Overlays.Wiki
|
||||
{
|
||||
yield return new Drawable[]
|
||||
{
|
||||
new WikiPanelContainer
|
||||
new WikiPanelContainer(panelsNode[i].InnerText, true)
|
||||
{
|
||||
Text = panelsNode[i].InnerText,
|
||||
IsFullWidth = true,
|
||||
Width = 2,
|
||||
},
|
||||
null,
|
||||
@ -91,14 +89,8 @@ namespace osu.Game.Overlays.Wiki
|
||||
{
|
||||
yield return new Drawable[]
|
||||
{
|
||||
new WikiPanelContainer
|
||||
{
|
||||
Text = panelsNode[i].InnerText,
|
||||
},
|
||||
new WikiPanelContainer
|
||||
{
|
||||
Text = panelsNode[i + 1].InnerText,
|
||||
},
|
||||
new WikiPanelContainer(panelsNode[i].InnerText),
|
||||
new WikiPanelContainer(panelsNode[i + 1].InnerText),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -23,12 +23,15 @@ namespace osu.Game.Overlays.Wiki
|
||||
{
|
||||
private WikiPanelMarkdownContainer panelContainer;
|
||||
|
||||
public string Text;
|
||||
private readonly string text;
|
||||
|
||||
public bool IsFullWidth;
|
||||
private readonly bool isFullWidth;
|
||||
|
||||
public WikiPanelContainer()
|
||||
public WikiPanelContainer(string text, bool isFullWidth = false)
|
||||
{
|
||||
this.text = text;
|
||||
this.isFullWidth = isFullWidth;
|
||||
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Padding = new MarginPadding(3);
|
||||
}
|
||||
@ -56,12 +59,11 @@ namespace osu.Game.Overlays.Wiki
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
},
|
||||
panelContainer = new WikiPanelMarkdownContainer
|
||||
panelContainer = new WikiPanelMarkdownContainer(isFullWidth)
|
||||
{
|
||||
Text = Text,
|
||||
Text = text,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
IsFullWidth = IsFullWidth,
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -74,10 +76,12 @@ namespace osu.Game.Overlays.Wiki
|
||||
|
||||
private class WikiPanelMarkdownContainer : WikiMarkdownContainer
|
||||
{
|
||||
public bool IsFullWidth;
|
||||
private readonly bool isFullWidth;
|
||||
|
||||
public WikiPanelMarkdownContainer()
|
||||
public WikiPanelMarkdownContainer(bool isFullWidth)
|
||||
{
|
||||
this.isFullWidth = isFullWidth;
|
||||
|
||||
LineSpacing = 0;
|
||||
DocumentPadding = new MarginPadding(30);
|
||||
DocumentMargin = new MarginPadding(0);
|
||||
@ -92,7 +96,7 @@ namespace osu.Game.Overlays.Wiki
|
||||
|
||||
protected override MarkdownHeading CreateHeading(HeadingBlock headingBlock) => new WikiPanelHeading(headingBlock)
|
||||
{
|
||||
IsFullWidth = IsFullWidth,
|
||||
IsFullWidth = isFullWidth,
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user