Interface TooltipMakerAPI

All Superinterfaces:
UIComponentAPI, UIPanelAPI

public interface TooltipMakerAPI extends UIPanelAPI
Not just for tooltips; used for normal UI elements as well.
Author:
Alex Mosolov Copyright 2018 Fractal Softworks, LLC
  • Method Details

    • addTitle

      LabelAPI addTitle(String text)
    • setTitleFont

      void setTitleFont(String titleFont)
    • setTitleSmallOrbitron

      void setTitleSmallOrbitron()
    • setTitleFontColor

      void setTitleFontColor(Color titleFontColor)
    • setParaFont

      void setParaFont(String paraFont)
    • setParaFontColor

      void setParaFontColor(Color paraFontColor)
    • setParaSmallInsignia

      void setParaSmallInsignia()
    • addPara

      LabelAPI addPara(String format, float pad, Color hl, String... highlights)
    • addPara

      LabelAPI addPara(String str, float pad)
    • addPara

      LabelAPI addPara(String str, Color color, float pad)
    • addSectionHeading

      LabelAPI addSectionHeading(String str, Alignment align, float pad)
    • addSectionHeading

      LabelAPI addSectionHeading(String str, Color textColor, Color bgColor, Alignment align, float pad)
    • beginGrid

      void beginGrid(float itemWidth, int cols)
    • beginGrid

      void beginGrid(float itemWidth, int cols, Color labelColor)
    • addToGrid

      Object addToGrid(int x, int y, String label, String value)
    • addToGrid

      Object addToGrid(int x, int y, String label, String value, Color valueColor)
    • setGridLabelColor

      void setGridLabelColor(Color nameColor)
    • addGrid

      void addGrid(float pad)
    • beginGridFlipped

      void beginGridFlipped(float itemWidth, int cols, float valueWidth, float valuePad)
    • beginGridFlipped

      void beginGridFlipped(float itemWidth, int cols, Color labelColor, float valueWidth, float valuePad)
    • addStatModGrid

      void addStatModGrid(float width, float valueWidth, float valuePad, float pad, MutableStat stat)
    • addStatModGrid

      void addStatModGrid(float width, float valueWidth, float valuePad, float pad, StatBonus stat)
    • addStatGridForShips

      void addStatGridForShips(float width, float valueWidth, float valuePad, float pad, CampaignFleetAPI fleet, int maxNum, boolean ascending, TooltipMakerAPI.FleetMemberValueGetter getter)
    • setGridFontDefault

      void setGridFontDefault()
    • setGridFont

      void setGridFont(String gridFont)
    • addStatModGrid

      void addStatModGrid(float width, float valueWidth, float valuePad, float pad, MutableStat stat, TooltipMakerAPI.StatModValueGetter getter)
    • addStatModGrid

      void addStatModGrid(float width, float valueWidth, float valuePad, float pad, StatBonus stat, TooltipMakerAPI.StatModValueGetter getter)
    • setParaSmallOrbitron

      void setParaSmallOrbitron()
    • addTitle

      LabelAPI addTitle(String text, Color color)
    • setParaFontVictor14

      void setParaFontVictor14()
    • addImage

      void addImage(String spriteName, float pad)
    • addImage

      void addImage(String spriteName, float width, float pad)
    • setParaFontDefault

      void setParaFontDefault()
    • setParaOrbitronLarge

      void setParaOrbitronLarge()
    • setParaOrbitronVeryLarge

      void setParaOrbitronVeryLarge()
    • setParaInsigniaLarge

      void setParaInsigniaLarge()
    • setParaInsigniaVeryLarge

      void setParaInsigniaVeryLarge()
    • setTitleOrbitronLarge

      void setTitleOrbitronLarge()
    • setTitleOrbitronVeryLarge

      void setTitleOrbitronVeryLarge()
    • beginIconGroup

      void beginIconGroup()
    • setIconSpacingMedium

      void setIconSpacingMedium()
    • setIconSpacingWide

      void setIconSpacingWide()
    • addIcons

      void addIcons(CommodityOnMarketAPI com, int num, IconRenderMode mode)
    • addIcons

      void addIcons(CommoditySpecAPI com, int num, IconRenderMode mode)
    • addIconGroup

      void addIconGroup(float pad)
    • addIconGroup

      void addIconGroup(float rowHeight, float pad)
    • cancelGrid

      void cancelGrid()
    • addIconGroupAndCenter

      void addIconGroupAndCenter(float pad)
      Assumes a single icon, hacky.
      Parameters:
      pad -
    • addStatModGrid

      void addStatModGrid(float width, float valueWidth, float valuePad, float pad, StatBonus stat, boolean showNonMods, TooltipMakerAPI.StatModValueGetter getter)
    • showCargo

      void showCargo(CargoAPI cargo, int max, boolean sort, float pad)
      Sort is based on stack size.
      Parameters:
      cargo -
      max -
      sort -
      pad -
    • showShips

      void showShips(List<FleetMemberAPI> ships, int max, boolean sort, float pad)
    • beginTable

      UIPanelAPI beginTable(FactionAPI faction, float itemHeight, Object... columns)
      Columns are pairs of <Float|Integer width>
      Parameters:
      faction -
      itemHeight -
      columns -
    • beginTable2

      UIPanelAPI beginTable2(FactionAPI faction, float itemHeight, boolean withBorder, boolean withHeader, Object... columns)
    • beginTable

      UIPanelAPI beginTable(Color base, Color dark, Color bright, float itemHeight, Object... columns)
      Columns are pairs of <Float|Integer width>
    • beginTable

      UIPanelAPI beginTable(Color base, Color dark, Color bright, float itemHeight, boolean withBorder, boolean withHeader, Object... columns)
    • addRow

      Object addRow(Object... data)
      Possible sets of data for a column: string | color, string | alignment, color, string | alignment, color, LabelAPI
      Parameters:
      data -
    • addRowWithGlow

      Object addRowWithGlow(Object... data)
      Possible sets of data for a column: string color, string alignment, color, string alignment, color, LabelAPI
      Parameters:
      data -
    • addTooltipToAddedRow

    • addTooltipToAddedRow

      void addTooltipToAddedRow(TooltipMakerAPI.TooltipCreator tc, TooltipMakerAPI.TooltipLocation loc, boolean recreateEveryFrame)
    • addTable

      void addTable(String emptyText, int andMore, float pad)
    • setGridValueColor

      void setGridValueColor(Color valueColor)
    • beginImageWithText

      TooltipMakerAPI beginImageWithText(String spriteName, float imageHeight)
    • addImageWithText

      UIPanelAPI addImageWithText(float pad)
    • addIconGroup

      void addIconGroup(float rowHeight, int rows, float pad)
    • addPara

      LabelAPI addPara(String format, float pad, Color color, Color hl, String... highlights)
    • setButtonFontDefault

      void setButtonFontDefault()
    • setButtonFontVictor10

      void setButtonFontVictor10()
    • setButtonFontVictor14

      void setButtonFontVictor14()
    • addButton

      ButtonAPI addButton(String text, Object data, float width, float height, float pad)
    • addButton

      ButtonAPI addButton(String text, Object data, Color base, Color bg, float width, float height, float pad)
    • addButton

      ButtonAPI addButton(String text, Object data, Color base, Color bg, Alignment align, CutStyle style, float width, float height, float pad)
    • setBulletedListMode

      void setBulletedListMode(String itemPrefix)
    • setBulletWidth

      void setBulletWidth(Float bulletWidth)
    • addCustom

      UIComponentAPI addCustom(UIComponentAPI comp, float pad)
    • getBulletedListPrefix

      String getBulletedListPrefix()
    • addImage

      void addImage(String spriteName, float width, float height, float pad)
    • getTextWidthOverride

      float getTextWidthOverride()
    • setTextWidthOverride

      void setTextWidthOverride(float textWidthOverride)
    • addImages

      void addImages(float width, float height, float pad, float imagePad, String... spriteNames)
    • resetGridRowHeight

      void resetGridRowHeight()
    • setLowGridRowHeight

      void setLowGridRowHeight()
    • setGridRowHeight

      void setGridRowHeight(float gridSize)
    • shortenString

      String shortenString(String in, float maxWidth)
    • addStatModGrid

      void addStatModGrid(float width, float valueWidth, float valuePad, float pad, MutableStat stat, boolean showNonMods, TooltipMakerAPI.StatModValueGetter getter)
    • addShipList

      void addShipList(int cols, int rows, float iconSize, Color baseColor, List<FleetMemberAPI> ships, float pad)
    • setParaFontOrbitron

      void setParaFontOrbitron()
    • addPara

      LabelAPI addPara(String format, float pad, Color[] hl, String... highlights)
    • addSpacer

      UIComponentAPI addSpacer(float height)
    • addStoryPointUseInfo

      void addStoryPointUseInfo(float pad, float bonusXPFraction, boolean withNoSPNotification)
    • addStoryPointUseInfo

      void addStoryPointUseInfo(float pad, int numPoints, float bonusXPFraction, boolean withNoSPNotification)
    • setForceProcessInput

      void setForceProcessInput(boolean forceProcessInput)
    • addPlaythroughDataPanel

      void addPlaythroughDataPanel(float width, float height)
    • setBulletColor

      void setBulletColor(Color bulletColor)
    • addRelationshipBar

      void addRelationshipBar(PersonAPI person, float pad)
    • addRelationshipBar

      void addRelationshipBar(PersonAPI person, float width, float pad)
    • addRelationshipBar

      void addRelationshipBar(FactionAPI faction, float pad)
    • addRelationshipBar

      void addRelationshipBar(FactionAPI faction, float width, float pad)
    • addRelationshipBar

      void addRelationshipBar(float value, float pad)
    • addRelationshipBar

      void addRelationshipBar(float value, float width, float pad)
    • addImportanceIndicator

      void addImportanceIndicator(PersonImportance importance, float width, float pad)
    • addTooltipToPrevious

    • addAreaCheckbox

      ButtonAPI addAreaCheckbox(String text, Object data, Color base, Color bg, Color bright, float width, float height, float pad)
    • showShips

      void showShips(List<FleetMemberAPI> ships, int max, boolean sort, boolean showBaseHullForDHulls, float pad)
    • setGridFontSmallInsignia

      void setGridFontSmallInsignia()
    • showFullSurveyReqs

      void showFullSurveyReqs(PlanetAPI planet, boolean withText, float pad)
    • showCost

      void showCost(String title, boolean withAvailable, float widthOverride, Color color, Color dark, float pad, String[] res, int[] quantities, boolean[] consumed)
    • showCost

      void showCost(String title, boolean withAvailable, Color color, Color dark, float pad, String[] res, int[] quantities)
    • showCost

      void showCost(Color color, Color dark, float pad, String[] res, int[] quantities)
    • showCost

      void showCost(String title, boolean withAvailable, float widthOverride, float heightOverride, Color color, Color dark, float pad, String[] res, int[] quantities, boolean[] consumed)
    • getPrev

      UIComponentAPI getPrev()
    • addAreaCheckbox

      ButtonAPI addAreaCheckbox(String text, Object data, Color base, Color bg, Color bright, float width, float height, float pad, boolean leftAlign)
    • addSkillPanel

      UIComponentAPI addSkillPanel(PersonAPI person, float pad)
    • addSkillPanelOneColumn

      UIComponentAPI addSkillPanelOneColumn(PersonAPI person, float pad)
    • computeStringWidth

      float computeStringWidth(String in)
    • addTextField

      TextFieldAPI addTextField(float width, float pad)
    • addTextField

      TextFieldAPI addTextField(float width, String font, float pad)
    • addTextField

      TextFieldAPI addTextField(float width, float height, String font, float pad)
    • addCheckbox

      @Deprecated ButtonAPI addCheckbox(float width, float height, String text, ButtonAPI.UICheckboxSize size, float pad)
      Deprecated.
      Use the method with the Object data param
    • addCheckbox

      @Deprecated ButtonAPI addCheckbox(float width, float height, String text, String font, Color textColor, ButtonAPI.UICheckboxSize size, float pad)
      Deprecated.
      Use the method with the Object data param
    • setAreaCheckboxFont

      void setAreaCheckboxFont(String areaCheckboxFont)
    • setAreaCheckboxFontDefault

      void setAreaCheckboxFontDefault()
    • addLabelledValue

      UIComponentAPI addLabelledValue(String label, String value, Color labelColor, Color valueColor, float width, float pad)
    • getHeightSoFar

      float getHeightSoFar()
    • getIntelUI

      IntelUIAPI getIntelUI()
      Returns the intel UI; only works when creating small intel descriptions.
      Returns:
    • addEventProgressBar

      EventProgressBarAPI addEventProgressBar(BaseEventIntel intel, float pad)
    • addCustomDoNotSetPosition

      UIComponentAPI addCustomDoNotSetPosition(UIComponentAPI comp)
      Add a custom component without appending it to the bottom of the tooltip. Will need to call one of the .getPosition().inXXX methods to actually place it somewhere specific within the tooltip.
      Parameters:
      comp -
      Returns:
    • addEventStageMarker

    • addEventProgressMarker

      UIComponentAPI addEventProgressMarker(BaseEventIntel intel)
    • beginImageWithText

      TooltipMakerAPI beginImageWithText(String spriteName, float imageHeight, float widthWithImage, boolean midAlignImage)
    • addSectionHeading

      LabelAPI addSectionHeading(String str, Color textColor, Color bgColor, Alignment align, float width, float pad)
    • beginSubTooltip

      TooltipMakerAPI beginSubTooltip(float width)
    • endSubTooltip

      void endSubTooltip()
      Tooltip still needs to be added using addCustom() or similar.
    • setHeightSoFar

      void setHeightSoFar(float height)
    • createSectorMap

      UIPanelAPI createSectorMap(float w, float h, MapParams p, String title)
      TODO: maps don't seem to work right if the tooltip is recreated every frame, for now make sure to use the addTooltipToPrevious method that takes a boolean to turn that off.
    • createSectorMap

      UIPanelAPI createSectorMap(float w, float h, MapParams p, String title, Color color, Color dark)
      TODO: maps don't seem to work right if the tooltip is recreated every frame, for now make sure to use the addTooltipToPrevious method that takes a boolean to turn that off.
    • getWidthSoFar

      float getWidthSoFar()
    • addTooltipToPrevious

      void addTooltipToPrevious(TooltipMakerAPI.TooltipCreator tc, TooltipMakerAPI.TooltipLocation loc, boolean recreateEveryFrame)
    • createLabel

      LabelAPI createLabel(String str, Color color)
      Create a label without adding it to the tooltip, so it can be added via addCustom() or passed in to a table row. Uses the current paragraph font.
    • createLabel

      LabelAPI createLabel(String str, Color color, float maxTextWidth)
      Create a label without adding it to the tooltip, so it can be added via addCustom() or passed in to a table row. Uses the current paragraph font.
    • addTableHeaderTooltip

      void addTableHeaderTooltip(int colIndex, TooltipMakerAPI.TooltipCreator tc)
    • addTableHeaderTooltip

      void addTableHeaderTooltip(int colIndex, String text)
    • addSectorMap

      UIPanelAPI addSectorMap(float w, float h, StarSystemAPI system, float pad)
    • addTooltipTo

    • addTooltipTo

      void addTooltipTo(TooltipMakerAPI.TooltipCreator tc, UIComponentAPI to, TooltipMakerAPI.TooltipLocation loc, boolean recreateEveryFrame)
    • createRect

      UIComponentAPI createRect(Color color, float thickness)
    • makeTableItemsClickable

      void makeTableItemsClickable()
    • setIdForAddedRow

      void setIdForAddedRow(Object id)
      To identify which row was clicked on.
      Parameters:
      id -
    • setExternalScroller

      void setExternalScroller(ScrollPanelAPI scroller)
    • getExternalScroller

      ScrollPanelAPI getExternalScroller()
      Only non-null if this tooltip was added to a CustomPanelAPI using addUIElement().
      Returns:
    • setBgAlpha

      void setBgAlpha(float bgAlpha)
      Default is 0.85f.
    • setButtonFontOrbitron20

      void setButtonFontOrbitron20()
    • setButtonFontOrbitron20Bold

      void setButtonFontOrbitron20Bold()
    • setButtonFontOrbitron24

      void setButtonFontOrbitron24()
    • setButtonFontOrbitron24Bold

      void setButtonFontOrbitron24Bold()
    • showPlanetInfo

      void showPlanetInfo(PlanetAPI planet, float pad)
    • showPlanetInfo

      void showPlanetInfo(PlanetAPI planet, float w, float h, boolean withName, float pad)
    • showPlanetInfo

      void showPlanetInfo(PlanetAPI planet, float w, float h, TooltipMakerAPI.PlanetInfoParams params, float pad)
    • addCheckbox

      ButtonAPI addCheckbox(float width, float height, String text, Object data, ButtonAPI.UICheckboxSize size, float pad)
    • addCheckbox

      ButtonAPI addCheckbox(float width, float height, String text, Object data, String font, Color textColor, ButtonAPI.UICheckboxSize size, float pad)
    • addSkillPanel

      UIComponentAPI addSkillPanel(PersonAPI person, boolean admin, float pad)
    • addSkillPanelOneColumn

      UIComponentAPI addSkillPanelOneColumn(PersonAPI person, boolean admin, float pad)
    • addCodexEntries

      void addCodexEntries(String title, Set<String> entryIds, boolean sort, float pad)
    • setCodexEntryId

      void setCodexEntryId(String codexEntryId)
      ID of codex entry to open with F2 when this tooltip is shown. Setting it to something and then back to null will not remove the "press F2" prompt etc. See: CodexDataV2.getXXXXEntryId() methods for how to get entry ids.
      Parameters:
      codexEntryId -
    • getCodexEntryId

      String getCodexEntryId()
    • setCodexEntryFleetMember

      void setCodexEntryFleetMember(FleetMemberAPI member)
    • setCodexTempEntry

      void setCodexTempEntry(CodexEntryPlugin tempCodexEntry)
    • addParaWithMarkup

      LabelAPI addParaWithMarkup(String str, float pad)
    • addParaWithMarkup

      LabelAPI addParaWithMarkup(String str, Color color, float pad)
    • addParaWithMarkup

      LabelAPI addParaWithMarkup(String str, float pad, String... tokens)
    • addParaWithMarkup

      LabelAPI addParaWithMarkup(String str, Color color, float pad, String... tokens)
      Markup: {{string}} -> highlights it {{color:|string}} -> highlights it with color color can be h|good|bad|text|gray|blue or a color in settings.json If passing in tokens and needing to use a % in the base string: use %% (tokens means a String.format call) If NOT passing in tokens and needing to use a % in the base string: use % (no String.format call)
      Parameters:
      str -
      color -
      pad -
      tokens -
      Returns:
    • showCargo

      void showCargo(CargoAPI cargo, int max, boolean sort, float pad, float itemHeight, float itemPad)
    • setActionListenerDelegate

      void setActionListenerDelegate(TooltipMakerAPI.ActionListenerDelegate delegate)
      Needs to be called *before* any methods that create UI elements that call the action listener (such as addButton) are called. Warning: If the TooltipMakerAPI already has an action listener, it will be overridden.
      Parameters:
      delegate -