Class InfoSection

java.lang.Object
org.cyclops.cyclopscore.infobook.InfoSection
Direct Known Subclasses:
InfoSectionTagIndex

public class InfoSection extends Object
Section of the info book. Can have child sections.
  • Field Details Link icon

  • Constructor Details Link icon

  • Method Details Link icon

    • getRelativeWebPath Link icon

      public String getRelativeWebPath()
    • addLinks Link icon

      protected 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.
    • shouldAddIndex Link icon

      protected boolean shouldAddIndex()
    • constructAllLinks Link icon

      protected static void constructAllLinks(InfoSection root, Map<String,org.apache.commons.lang3.tuple.Pair<InfoSection,Integer>> softLinks, int indent, int maxDepth)
    • bakeSection Link icon

      public 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.
    • trimStringToWidth Link icon

      protected static List<net.minecraft.util.FormattedCharSequence> trimStringToWidth(net.minecraft.client.gui.Font fontRenderer, net.minecraft.network.chat.FormattedText text, int width)
    • getAppendixLineHeight Link icon

      protected static int getAppendixLineHeight(SectionAppendix appendix, net.minecraft.client.gui.Font fontRenderer)
    • getFontHeight Link icon

      public static int getFontHeight(net.minecraft.client.gui.Font fontRenderer)
    • isTitlePage Link icon

      public boolean isTitlePage(int page)
    • registerSection Link icon

      public void registerSection(InfoSection section)
    • getPages Link icon

      public int getPages()
    • formatString Link icon

      public static String formatString(String string)
      Give 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 Link icon

      protected List<net.minecraft.util.FormattedCharSequence> getLocalizedPageLines(int page)
    • getLocalizedTitle Link icon

      public String getLocalizedTitle()
    • getSubSections Link icon

      public int getSubSections()
    • getSubSection Link icon

      public InfoSection getSubSection(int index)
    • getParent Link icon

      public InfoSection getParent()
    • isRoot Link icon

      public boolean isRoot()
    • getChildIndex Link icon

      public int getChildIndex()
    • getLinks Link icon

      public List<HyperLink> getLinks(int page)
    • drawScreen Link icon

      public 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
    • postDrawScreen Link icon

      public 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.
    • getNext Link icon

      public 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.
      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.
    • getPrevious Link icon

      public 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.
      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.
    • getAppendixOffsetLine Link icon

      protected static int getAppendixOffsetLine(net.minecraft.client.gui.Font fontRenderer, SectionAppendix appendix)
    • getTags Link icon

      public ArrayList<String> getTags()
    • getAdvancedButtons Link icon

      public List<AdvancedButton> getAdvancedButtons(int page)
    • addAdvancedButton Link icon

      public void addAdvancedButton(int page, AdvancedButton advancedButton)
    • addAdvancedButtons Link icon

      public <T extends AdvancedButton> void addAdvancedButtons(int page, Collection<T> advancedButtons)