Package org.cyclops.cyclopscore.infobook
Class InfoSection
java.lang.Object
org.cyclops.cyclopscore.infobook.InfoSection
- Direct Known Subclasses:
- InfoSectionTagIndex
Section of the info book.
 Can have child sections.
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionInfoSection(IInfoBook infoBook, InfoSection parent, int childIndex, String translationKey, List<String> paragraphs, List<SectionAppendix> appendixes, ArrayList<String> tagList) Deprecated.InfoSection(IInfoBook infoBook, InfoSection parent, int childIndex, String translationKey, List<String> paragraphs, List<SectionAppendix> appendixes, ArrayList<String> tagList, ModBase<?> mod) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddAdvancedButton(int page, AdvancedButton advancedButton) <T extends AdvancedButton>
 voidaddAdvancedButtons(int page, Collection<T> advancedButtons) protected voidaddLinks(int maxLines, int lineHeight, int yOffset, Map<String, org.apache.commons.lang3.tuple.Pair<InfoSection, Integer>> softLinks) Add all links from the given map to this section, starting from page 0.voidbakeSection(net.minecraft.client.gui.Font fontRenderer, int width, int maxLines, int lineHeight, int yOffset) Will make a localized version of this section with a variable amount of paragraphs.protected static voidconstructAllLinks(InfoSection root, Map<String, org.apache.commons.lang3.tuple.Pair<InfoSection, Integer>> softLinks, int indent, int maxDepth) voiddrawScreen(ScreenInfoBook gui, net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, int yOffset, int width, int height, int page, int mx, int my, int footnoteOffsetX, int footnoteOffsetY) Draw the screen for a given page.static StringformatString(String string) Give the correct format to a string.getAdvancedButtons(int page) protected static intgetAppendixLineHeight(SectionAppendix appendix, net.minecraft.client.gui.Font fontRenderer) protected static intgetAppendixOffsetLine(net.minecraft.client.gui.Font fontRenderer, SectionAppendix appendix) intstatic intgetFontHeight(net.minecraft.client.gui.Font fontRenderer) getLinks(int page) protected List<net.minecraft.util.FormattedCharSequence> getLocalizedPageLines(int page) getNext(int page, boolean stepSection) Get the next InfoSection relative to this one plus page in this tree hierarchy using pre-order traversal.intgetPages()getPrevious(int page, boolean stepSection) Get the previous InfoSection relative to this one plus page in this tree hierarchy using pre-order traversal.getSubSection(int index) intgetTags()booleanisRoot()booleanisTitlePage(int page) voidpostDrawScreen(ScreenInfoBook gui, net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, int width, int height, int page, int mx, int my) Draw the overlays for the given page, for tooltips and such.voidregisterSection(InfoSection section) protected booleanprotected static List<net.minecraft.util.FormattedCharSequence> trimStringToWidth(net.minecraft.client.gui.Font fontRenderer, net.minecraft.network.chat.FormattedText text, int width) 
- 
Field Details- 
paragraphs
 
- 
- 
Constructor Details- 
InfoSectionpublic InfoSection(IInfoBook infoBook, InfoSection parent, int childIndex, String translationKey, List<String> paragraphs, List<SectionAppendix> appendixes, ArrayList<String> tagList, ModBase<?> mod) 
- 
InfoSection@Deprecated public InfoSection(IInfoBook infoBook, InfoSection parent, int childIndex, String translationKey, List<String> paragraphs, List<SectionAppendix> appendixes, ArrayList<String> tagList) Deprecated.
 
- 
- 
Method Details- 
getRelativeWebPath
- 
addLinksprotected void addLinks(int maxLines, int lineHeight, int yOffset, Map<String, org.apache.commons.lang3.tuple.Pair<InfoSection, Integer>> softLinks) Add all links from the given map to this section, starting from page 0.- Parameters:
- maxLines- The maximum amount of lines per page.
- lineHeight- The line height.
- yOffset- The y gui offset.
- softLinks- The map of links.
 
- 
shouldAddIndexprotected boolean shouldAddIndex()
- 
constructAllLinksprotected static void constructAllLinks(InfoSection root, Map<String, org.apache.commons.lang3.tuple.Pair<InfoSection, Integer>> softLinks, int indent, int maxDepth) 
- 
bakeSectionpublic void bakeSection(net.minecraft.client.gui.Font fontRenderer, int width, int maxLines, int lineHeight, int yOffset) Will make a localized version of this section with a variable amount of paragraphs. Must be called once before the section will be drawn.- Parameters:
- fontRenderer- The font renderer.
- width- Section width
- maxLines- The maximum amount of lines per page.
- lineHeight- The line height.
- yOffset- The y gui offset.
 
- 
trimStringToWidthprotected static List<net.minecraft.util.FormattedCharSequence> trimStringToWidth(net.minecraft.client.gui.Font fontRenderer, net.minecraft.network.chat.FormattedText text, int width) 
- 
getAppendixLineHeightprotected static int getAppendixLineHeight(SectionAppendix appendix, net.minecraft.client.gui.Font fontRenderer) 
- 
getFontHeightpublic static int getFontHeight(net.minecraft.client.gui.Font fontRenderer) 
- 
isTitlePagepublic boolean isTitlePage(int page) 
- 
registerSection
- 
getPagespublic int getPages()
- 
formatStringGive the correct format to a string. Will allow the convenient "&" format codes to be used instead of "ยง": http://minecraft.gamepedia.com/Formatting_codes Will also refresh all formats at the end of the string. This will replace "&N"'s with a newlines.- Parameters:
- string- The string to format.
- Returns:
- The formatted string.
 
- 
getLocalizedPageLines
- 
getLocalizedTitle
- 
getSubSectionspublic int getSubSections()
- 
getSubSection
- 
getParent
- 
isRootpublic boolean isRoot()
- 
getChildIndexpublic int getChildIndex()
- 
getLinks
- 
drawScreenpublic void drawScreen(ScreenInfoBook gui, net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, int yOffset, int width, int height, int page, int mx, int my, int footnoteOffsetX, int footnoteOffsetY) Draw the screen for a given page.- Parameters:
- gui- The gui.
- guiGraphics- The gui graphics object
- mouseX- X.
- mouseY- Y.
- yOffset- The y offset.
- width- The width of the page.
- height- The height of the page.
- page- The page to render.
- mx- Mouse X.
- my- Mouse Y.
- footnoteOffsetX- Footnote offset x
- footnoteOffsetY- Footnote offset y
 
- 
postDrawScreenpublic void postDrawScreen(ScreenInfoBook gui, net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, int width, int height, int page, int mx, int my) Draw the overlays for the given page, for tooltips and such.- Parameters:
- gui- The gui.
- guiGraphics- The gui graphics object.
- mouseX- X.
- mouseY- Y.
- width- The width of the page.
- height- The height of the page.
- page- The page to render.
- mx- Mouse X.
- my- Mouse Y.
 
- 
getNextGet the next InfoSection relative to this one plus page in this tree hierarchy using pre-order traversal.- Parameters:
- page- The current page.
- stepSection- Take a complete section as traversal step.
- Returns:
- The next location or the current location if this was the last location.
 
- 
getPreviousGet the previous InfoSection relative to this one plus page in this tree hierarchy using pre-order traversal.- Parameters:
- page- The current page.
- stepSection- Take a complete section as traversal step.
- Returns:
- The previous location or the current location if this was the last location.
 
- 
getAppendixOffsetLineprotected static int getAppendixOffsetLine(net.minecraft.client.gui.Font fontRenderer, SectionAppendix appendix) 
- 
getTags
- 
getAdvancedButtons
- 
addAdvancedButton
- 
addAdvancedButtons
 
-