public class InfoSection
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
InfoSection.Location |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<java.lang.String> |
paragraphs |
static int |
Y_OFFSET |
| Constructor and Description |
|---|
InfoSection(InfoSection parent,
int childIndex,
java.lang.String unlocalizedName,
java.util.List<java.lang.String> paragraphs,
java.util.List<SectionAppendix> appendixes,
java.util.ArrayList<java.lang.String> tagList) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAdvancedButton(int page,
AdvancedButton advancedButton) |
<T extends AdvancedButton> |
addAdvancedButtons(int page,
java.util.Collection<T> advancedButtons) |
protected void |
addLinks(int maxLines,
int lineHeight,
java.util.Map<java.lang.String,org.apache.commons.lang3.tuple.Pair<InfoSection,java.lang.Integer>> softLinks)
Add all links from the given map to this section, starting from page 0.
|
void |
bakeSection(net.minecraft.client.gui.FontRenderer fontRenderer,
int width,
int maxLines,
int lineHeight)
Will make a localized version of this section with a variable amount of paragraphs.
|
protected static void |
constructAllLinks(InfoSection root,
java.util.Map<java.lang.String,org.apache.commons.lang3.tuple.Pair<InfoSection,java.lang.Integer>> softLinks,
int indent,
int maxDepth) |
void |
drawScreen(GuiOriginsOfDarkness gui,
int x,
int y,
int width,
int height,
int page,
int mx,
int my)
Draw the screen for a given page.
|
static java.lang.String |
formatString(java.lang.String string)
Give the correct format to a string.
|
java.util.List<AdvancedButton> |
getAdvancedButtons(int page) |
protected static int |
getAppendixLineHeight(SectionAppendix appendix,
net.minecraft.client.gui.FontRenderer fontRenderer) |
protected static int |
getAppendixOffsetLine(net.minecraft.client.gui.FontRenderer fontRenderer,
SectionAppendix appendix) |
int |
getChildIndex() |
static int |
getFontHeight(net.minecraft.client.gui.FontRenderer fontRenderer) |
java.util.List<HyperLink> |
getLinks(int page) |
protected java.lang.String |
getLocalizedPageString(int page) |
java.lang.String |
getLocalizedTitle() |
InfoSection.Location |
getNext(int page,
boolean stepSection)
Get the next InfoSection relative to this one plus page in this tree hierarchy using pre-order traversal.
|
int |
getPages() |
InfoSection |
getParent() |
InfoSection.Location |
getPrevious(int page,
boolean stepSection)
Get the previous InfoSection relative to this one plus page in this tree hierarchy using pre-order traversal.
|
InfoSection |
getSubSection(int index) |
int |
getSubSections() |
java.util.ArrayList<java.lang.String> |
getTags() |
boolean |
isRoot() |
boolean |
isTitlePage(int page) |
void |
postDrawScreen(GuiOriginsOfDarkness gui,
int x,
int y,
int width,
int height,
int page,
int mx,
int my)
Draw the overlays for the given page, for tooltips and such.
|
void |
registerSection(InfoSection section) |
protected boolean |
shouldAddIndex() |
public static final int Y_OFFSET
protected java.util.List<java.lang.String> paragraphs
public InfoSection(InfoSection parent, int childIndex, java.lang.String unlocalizedName, java.util.List<java.lang.String> paragraphs, java.util.List<SectionAppendix> appendixes, java.util.ArrayList<java.lang.String> tagList)
protected void addLinks(int maxLines,
int lineHeight,
java.util.Map<java.lang.String,org.apache.commons.lang3.tuple.Pair<InfoSection,java.lang.Integer>> softLinks)
maxLines - The maximum amount of lines per page.lineHeight - The line height.softLinks - The map of links.protected boolean shouldAddIndex()
protected static void constructAllLinks(InfoSection root, java.util.Map<java.lang.String,org.apache.commons.lang3.tuple.Pair<InfoSection,java.lang.Integer>> softLinks, int indent, int maxDepth)
public void bakeSection(net.minecraft.client.gui.FontRenderer fontRenderer,
int width,
int maxLines,
int lineHeight)
fontRenderer - The font renderer.width - Section widthmaxLines - The maximum amount of lines per page.lineHeight - The line height.protected static final int getAppendixLineHeight(SectionAppendix appendix, net.minecraft.client.gui.FontRenderer fontRenderer)
public static int getFontHeight(net.minecraft.client.gui.FontRenderer fontRenderer)
public boolean isTitlePage(int page)
public void registerSection(InfoSection section)
public int getPages()
public static java.lang.String formatString(java.lang.String string)
string - The string to format.protected java.lang.String getLocalizedPageString(int page)
public java.lang.String getLocalizedTitle()
public int getSubSections()
public InfoSection getSubSection(int index)
public InfoSection getParent()
public boolean isRoot()
public int getChildIndex()
public java.util.List<HyperLink> getLinks(int page)
public void drawScreen(GuiOriginsOfDarkness gui, int x, int y, int width, int height, int page, int mx, int my)
gui - The gui.x - X.y - Y.width - The width of the page.height - The height of the page.page - The page to render.mx - Mouse X.my - Mouse Y.public void postDrawScreen(GuiOriginsOfDarkness gui, int x, int y, int width, int height, int page, int mx, int my)
gui - The gui.x - X.y - Y.width - The width of the page.height - The height of the page.page - The page to render.mx - Mouse X.my - Mouse Y.public InfoSection.Location getNext(int page, boolean stepSection)
page - The current page.stepSection - Take a complete section as traversal step.public InfoSection.Location getPrevious(int page, boolean stepSection)
page - The current page.stepSection - Take a complete section as traversal step.protected static int getAppendixOffsetLine(net.minecraft.client.gui.FontRenderer fontRenderer,
SectionAppendix appendix)
public java.util.ArrayList<java.lang.String> getTags()
public java.util.List<AdvancedButton> getAdvancedButtons(int page)
public void addAdvancedButton(int page,
AdvancedButton advancedButton)
public <T extends AdvancedButton> void addAdvancedButtons(int page, java.util.Collection<T> advancedButtons)