Package com.fs.starfarer.api.ui
Interface TooltipMakerAPI
- All Superinterfaces:
UIComponentAPI
,UIPanelAPI
Not just for tooltips; used for normal UI elements as well.
- Author:
- Alex Mosolov Copyright 2018 Fractal Softworks, LLC
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static interface
static class
static interface
static interface
static enum
-
Method Summary
Modifier and TypeMethodDescriptionaddAreaCheckbox
(String text, Object data, Color base, Color bg, Color bright, float width, float height, float pad) addAreaCheckbox
(String text, Object data, Color base, Color bg, Color bright, float width, float height, float pad, boolean leftAlign) addButton
(String text, Object data, Color base, Color bg, Alignment align, CutStyle style, float width, float height, float pad) addCheckbox
(float width, float height, String text, ButtonAPI.UICheckboxSize size, float pad) Deprecated.addCheckbox
(float width, float height, String text, Object data, ButtonAPI.UICheckboxSize size, float pad) addCheckbox
(float width, float height, String text, Object data, String font, Color textColor, ButtonAPI.UICheckboxSize size, float pad) addCheckbox
(float width, float height, String text, String font, Color textColor, ButtonAPI.UICheckboxSize size, float pad) Deprecated.void
addCodexEntries
(String title, Set<String> entryIds, boolean sort, float pad) addCustom
(UIComponentAPI comp, float pad) Add a custom component without appending it to the bottom of the tooltip.addEventProgressBar
(BaseEventIntel intel, float pad) void
addGrid
(float pad) void
addIconGroup
(float pad) void
addIconGroup
(float rowHeight, float pad) void
addIconGroup
(float rowHeight, int rows, float pad) void
addIconGroupAndCenter
(float pad) Assumes a single icon, hacky.void
addIcons
(CommodityOnMarketAPI com, int num, IconRenderMode mode) void
addIcons
(CommoditySpecAPI com, int num, IconRenderMode mode) void
void
void
void
addImageWithText
(float pad) void
addImportanceIndicator
(PersonImportance importance, float width, float pad) addLabelledValue
(String label, String value, Color labelColor, Color valueColor, float width, float pad) addParaWithMarkup
(String str, float pad) addParaWithMarkup
(String str, float pad, String... tokens) addParaWithMarkup
(String str, Color color, float pad) 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) void
addPlaythroughDataPanel
(float width, float height) void
addRelationshipBar
(float value, float pad) void
addRelationshipBar
(float value, float width, float pad) void
addRelationshipBar
(FactionAPI faction, float pad) void
addRelationshipBar
(FactionAPI faction, float width, float pad) void
addRelationshipBar
(PersonAPI person, float pad) void
addRelationshipBar
(PersonAPI person, float width, float pad) Possible sets of data for a column: string | color, string | alignment, color, string | alignment, color, LabelAPIaddRowWithGlow
(Object... data) Possible sets of data for a column: string color, string alignment, color, string alignment, color, LabelAPIaddSectionHeading
(String str, Alignment align, float pad) addSectionHeading
(String str, Color textColor, Color bgColor, Alignment align, float pad) addSectionHeading
(String str, Color textColor, Color bgColor, Alignment align, float width, float pad) addSectorMap
(float w, float h, StarSystemAPI system, float pad) void
addShipList
(int cols, int rows, float iconSize, Color baseColor, List<FleetMemberAPI> ships, float pad) addSkillPanel
(PersonAPI person, boolean admin, float pad) addSkillPanel
(PersonAPI person, float pad) addSkillPanelOneColumn
(PersonAPI person, boolean admin, float pad) addSkillPanelOneColumn
(PersonAPI person, float pad) addSpacer
(float height) void
addStatGridForShips
(float width, float valueWidth, float valuePad, float pad, CampaignFleetAPI fleet, int maxNum, boolean ascending, TooltipMakerAPI.FleetMemberValueGetter getter) void
addStatModGrid
(float width, float valueWidth, float valuePad, float pad, MutableStat stat) void
addStatModGrid
(float width, float valueWidth, float valuePad, float pad, MutableStat stat, boolean showNonMods, TooltipMakerAPI.StatModValueGetter getter) void
addStatModGrid
(float width, float valueWidth, float valuePad, float pad, MutableStat stat, TooltipMakerAPI.StatModValueGetter getter) void
addStatModGrid
(float width, float valueWidth, float valuePad, float pad, StatBonus stat) void
addStatModGrid
(float width, float valueWidth, float valuePad, float pad, StatBonus stat, boolean showNonMods, TooltipMakerAPI.StatModValueGetter getter) void
addStatModGrid
(float width, float valueWidth, float valuePad, float pad, StatBonus stat, TooltipMakerAPI.StatModValueGetter getter) void
addStoryPointUseInfo
(float pad, float bonusXPFraction, boolean withNoSPNotification) void
addStoryPointUseInfo
(float pad, int numPoints, float bonusXPFraction, boolean withNoSPNotification) void
void
addTableHeaderTooltip
(int colIndex, TooltipMakerAPI.TooltipCreator tc) void
addTableHeaderTooltip
(int colIndex, String text) addTextField
(float width, float pad) addTextField
(float width, float height, String font, float pad) addTextField
(float width, String font, float pad) void
addTooltipTo
(TooltipMakerAPI.TooltipCreator tc, UIComponentAPI to, TooltipMakerAPI.TooltipLocation loc) void
addTooltipTo
(TooltipMakerAPI.TooltipCreator tc, UIComponentAPI to, TooltipMakerAPI.TooltipLocation loc, boolean recreateEveryFrame) void
void
addTooltipToAddedRow
(TooltipMakerAPI.TooltipCreator tc, TooltipMakerAPI.TooltipLocation loc, boolean recreateEveryFrame) void
void
addTooltipToPrevious
(TooltipMakerAPI.TooltipCreator tc, TooltipMakerAPI.TooltipLocation loc, boolean recreateEveryFrame) void
beginGrid
(float itemWidth, int cols) void
void
beginGridFlipped
(float itemWidth, int cols, float valueWidth, float valuePad) void
beginGridFlipped
(float itemWidth, int cols, Color labelColor, float valueWidth, float valuePad) void
beginImageWithText
(String spriteName, float imageHeight) beginImageWithText
(String spriteName, float imageHeight, float widthWithImage, boolean midAlignImage) beginSubTooltip
(float width) beginTable
(FactionAPI faction, float itemHeight, Object... columns) Columns are pairs of<Float|Integer width> beginTable
(Color base, Color dark, Color bright, float itemHeight, boolean withBorder, boolean withHeader, Object... columns) beginTable
(Color base, Color dark, Color bright, float itemHeight, Object... columns) Columns are pairs of<Float|Integer width> beginTable2
(FactionAPI faction, float itemHeight, boolean withBorder, boolean withHeader, Object... columns) void
float
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.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.createRect
(Color color, float thickness) 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
(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.void
Tooltip still needs to be added using addCustom() or similar.Only non-null if this tooltip was added to a CustomPanelAPI using addUIElement().float
Returns the intel UI; only works when creating small intel descriptions.getPrev()
float
float
void
void
void
Needs to be called *before* any methods that create UI elements that call the action listener (such as addButton) are called.void
setAreaCheckboxFont
(String areaCheckboxFont) void
void
setBgAlpha
(float bgAlpha) Default is 0.85f.void
setBulletColor
(Color bulletColor) void
setBulletedListMode
(String itemPrefix) void
setBulletWidth
(Float bulletWidth) void
void
void
void
void
void
void
void
void
setCodexEntryId
(String codexEntryId) ID of codex entry to open with F2 when this tooltip is shown.void
setCodexTempEntry
(CodexEntryPlugin tempCodexEntry) void
setExternalScroller
(ScrollPanelAPI scroller) void
setForceProcessInput
(boolean forceProcessInput) void
setGridFont
(String gridFont) void
void
void
setGridLabelColor
(Color nameColor) void
setGridRowHeight
(float gridSize) void
setGridValueColor
(Color valueColor) void
setHeightSoFar
(float height) void
void
void
To identify which row was clicked on.void
void
setParaFont
(String paraFont) void
setParaFontColor
(Color paraFontColor) void
void
void
void
void
void
void
void
void
void
setTextWidthOverride
(float textWidthOverride) void
setTitleFont
(String titleFont) void
setTitleFontColor
(Color titleFontColor) void
void
void
shortenString
(String in, float maxWidth) void
Sort is based on stack size.void
void
void
showCost
(String title, boolean withAvailable, float widthOverride, float heightOverride, Color color, Color dark, float pad, String[] res, int[] quantities, boolean[] consumed) void
showCost
(String title, boolean withAvailable, float widthOverride, Color color, Color dark, float pad, String[] res, int[] quantities, boolean[] consumed) void
showCost
(String title, boolean withAvailable, Color color, Color dark, float pad, String[] res, int[] quantities) void
showFullSurveyReqs
(PlanetAPI planet, boolean withText, float pad) void
showPlanetInfo
(PlanetAPI planet, float pad) void
showPlanetInfo
(PlanetAPI planet, float w, float h, boolean withName, float pad) void
showPlanetInfo
(PlanetAPI planet, float w, float h, TooltipMakerAPI.PlanetInfoParams params, float pad) void
showShips
(List<FleetMemberAPI> ships, int max, boolean sort, boolean showBaseHullForDHulls, float pad) void
showShips
(List<FleetMemberAPI> ships, int max, boolean sort, float pad) Methods inherited from interface com.fs.starfarer.api.ui.UIComponentAPI
advance, getOpacity, getPosition, processInput, render, setOpacity
Methods inherited from interface com.fs.starfarer.api.ui.UIPanelAPI
addComponent, bringComponentToTop, removeComponent, sendToBottom
-
Method Details
-
addTitle
-
setTitleFont
-
setTitleSmallOrbitron
void setTitleSmallOrbitron() -
setTitleFontColor
-
setParaFont
-
setParaFontColor
-
setParaSmallInsignia
void setParaSmallInsignia() -
addPara
-
addPara
-
addPara
-
addSectionHeading
-
addSectionHeading
-
beginGrid
void beginGrid(float itemWidth, int cols) -
beginGrid
-
addToGrid
-
addToGrid
-
setGridLabelColor
-
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
-
addStatModGrid
-
addStatGridForShips
void addStatGridForShips(float width, float valueWidth, float valuePad, float pad, CampaignFleetAPI fleet, int maxNum, boolean ascending, TooltipMakerAPI.FleetMemberValueGetter getter) -
setGridFontDefault
void setGridFontDefault() -
setGridFont
-
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
-
setParaFontVictor14
void setParaFontVictor14() -
addImage
-
addImage
-
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
-
addIcons
-
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
Sort is based on stack size.- Parameters:
cargo
-max
-sort
-pad
-
-
showShips
-
beginTable
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
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
Possible sets of data for a column: string | color, string | alignment, color, string | alignment, color, LabelAPI- Parameters:
data
-
-
addRowWithGlow
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
-
setGridValueColor
-
beginImageWithText
-
addImageWithText
-
addIconGroup
void addIconGroup(float rowHeight, int rows, float pad) -
addPara
-
setButtonFontDefault
void setButtonFontDefault() -
setButtonFontVictor10
void setButtonFontVictor10() -
setButtonFontVictor14
void setButtonFontVictor14() -
addButton
-
addButton
-
addButton
-
setBulletedListMode
-
setBulletWidth
-
addCustom
-
getBulletedListPrefix
String getBulletedListPrefix() -
addImage
-
getTextWidthOverride
float getTextWidthOverride() -
setTextWidthOverride
void setTextWidthOverride(float textWidthOverride) -
addImages
-
resetGridRowHeight
void resetGridRowHeight() -
setLowGridRowHeight
void setLowGridRowHeight() -
setGridRowHeight
void setGridRowHeight(float gridSize) -
shortenString
-
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
-
addSpacer
-
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
-
addRelationshipBar
-
addRelationshipBar
-
addRelationshipBar
-
addRelationshipBar
-
addRelationshipBar
void addRelationshipBar(float value, float pad) -
addRelationshipBar
void addRelationshipBar(float value, float width, float pad) -
addImportanceIndicator
-
addTooltipToPrevious
-
addAreaCheckbox
-
showShips
void showShips(List<FleetMemberAPI> ships, int max, boolean sort, boolean showBaseHullForDHulls, float pad) -
setGridFontSmallInsignia
void setGridFontSmallInsignia() -
showFullSurveyReqs
-
showCost
-
showCost
-
showCost
-
showCost
-
getPrev
UIComponentAPI getPrev() -
addAreaCheckbox
-
addSkillPanel
-
addSkillPanelOneColumn
-
computeStringWidth
-
addTextField
-
addTextField
-
addTextField
-
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
-
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
-
addCustomDoNotSetPosition
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
-
beginImageWithText
TooltipMakerAPI beginImageWithText(String spriteName, float imageHeight, float widthWithImage, boolean midAlignImage) -
addSectionHeading
-
beginSubTooltip
-
endSubTooltip
void endSubTooltip()Tooltip still needs to be added using addCustom() or similar. -
setHeightSoFar
void setHeightSoFar(float height) -
createSectorMap
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
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
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
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
-
addTableHeaderTooltip
-
addSectorMap
-
addTooltipTo
void addTooltipTo(TooltipMakerAPI.TooltipCreator tc, UIComponentAPI to, TooltipMakerAPI.TooltipLocation loc) -
addTooltipTo
void addTooltipTo(TooltipMakerAPI.TooltipCreator tc, UIComponentAPI to, TooltipMakerAPI.TooltipLocation loc, boolean recreateEveryFrame) -
createRect
-
makeTableItemsClickable
void makeTableItemsClickable() -
setIdForAddedRow
To identify which row was clicked on.- Parameters:
id
-
-
setExternalScroller
-
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
-
showPlanetInfo
-
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
-
addSkillPanel
-
addSkillPanelOneColumn
-
addCodexEntries
-
setCodexEntryId
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
-
setCodexTempEntry
-
addParaWithMarkup
-
addParaWithMarkup
-
addParaWithMarkup
-
addParaWithMarkup
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
-
setActionListenerDelegate
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
-
-