Starsector API
Loading...
Searching...
No Matches
TooltipMakerAPI.java
Go to the documentation of this file.
1package com.fs.starfarer.api.ui;
2
3import java.util.List;
4import java.util.Set;
5
6import java.awt.Color;
7
8import com.fs.starfarer.api.campaign.CampaignFleetAPI;
9import com.fs.starfarer.api.campaign.CargoAPI;
10import com.fs.starfarer.api.campaign.FactionAPI;
11import com.fs.starfarer.api.campaign.PersonImportance;
12import com.fs.starfarer.api.campaign.PlanetAPI;
13import com.fs.starfarer.api.campaign.StarSystemAPI;
14import com.fs.starfarer.api.campaign.econ.CommodityOnMarketAPI;
15import com.fs.starfarer.api.campaign.econ.CommoditySpecAPI;
16import com.fs.starfarer.api.characters.PersonAPI;
17import com.fs.starfarer.api.combat.MutableStat;
18import com.fs.starfarer.api.combat.MutableStat.StatMod;
19import com.fs.starfarer.api.combat.StatBonus;
20import com.fs.starfarer.api.fleet.FleetMemberAPI;
21import com.fs.starfarer.api.impl.campaign.intel.events.BaseEventIntel;
22import com.fs.starfarer.api.impl.campaign.intel.events.BaseEventIntel.EventStageDisplayData;
23import com.fs.starfarer.api.impl.codex.CodexEntryPlugin;
24import com.fs.starfarer.api.ui.ButtonAPI.UICheckboxSize;
25
26
27
35public interface TooltipMakerAPI extends UIPanelAPI {
36
37 public static enum TooltipLocation {
38 LEFT,
39 RIGHT,
40 ABOVE,
41 BELOW;
42 }
43
44 public static interface ActionListenerDelegate {
45 void actionPerformed(Object data, Object source);
46 }
47
48 public static class PlanetInfoParams {
49 public boolean scaleEvenWhenShowingName = false;
50 public boolean showName;
51 public boolean withClass;
52 public String classStrOverride = null;
53 public boolean showConditions;
54 public float conditionsYOffset = 0f;
55 public float conditionsHeight = 32f;
56 public boolean showHazardRating = false;
57 }
58
59 public interface TooltipCreator {
60 boolean isTooltipExpandable(Object tooltipParam);
61 float getTooltipWidth(Object tooltipParam);
62 void createTooltip(TooltipMakerAPI tooltip, boolean expanded, Object tooltipParam);
63 }
64
65 public interface StatModValueGetter {
66 String getFlatValue(StatMod mod);
67 String getPercentValue(StatMod mod);
68 String getMultValue(StatMod mod);
69 Color getModColor(StatMod mod);
70 }
71
72 public interface FleetMemberValueGetter {
73 boolean skipMember(FleetMemberAPI member);
74 float getValue(FleetMemberAPI member);
77 }
78
79 LabelAPI addTitle(String text);
80 void setTitleFont(String titleFont);
82 void setTitleFontColor(Color titleFontColor);
83
84 void setParaFont(String paraFont);
85 void setParaFontColor(Color paraFontColor);
87
88 LabelAPI addPara(String format, float pad, Color hl, String... highlights);
89 LabelAPI addPara(String str, float pad);
90 LabelAPI addPara(String str, Color color, float pad);
91 LabelAPI addSectionHeading(String str, Alignment align, float pad);
92 LabelAPI addSectionHeading(String str, Color textColor, Color bgColor, Alignment align, float pad);
93
94 void beginGrid(float itemWidth, int cols);
95 void beginGrid(float itemWidth, int cols, Color labelColor);
96 Object addToGrid(int x, int y, String label, String value);
97 Object addToGrid(int x, int y, String label, String value, Color valueColor);
98 void setGridLabelColor(Color nameColor);
99 void addGrid(float pad);
100 void beginGridFlipped(float itemWidth, int cols, float valueWidth, float valuePad);
101 void beginGridFlipped(float itemWidth, int cols, Color labelColor, float valueWidth, float valuePad);
102 void addStatModGrid(float width, float valueWidth, float valuePad, float pad, MutableStat stat);
103 void addStatModGrid(float width, float valueWidth, float valuePad, float pad, StatBonus stat);
104 void addStatGridForShips(float width, float valueWidth, float valuePad, float pad,
105 CampaignFleetAPI fleet, int maxNum, boolean ascending,
108 void setGridFont(String gridFont);
109 void addStatModGrid(float width, float valueWidth, float valuePad,
110 float pad, MutableStat stat, StatModValueGetter getter);
111 void addStatModGrid(float width, float valueWidth, float valuePad,
112 float pad, StatBonus stat, StatModValueGetter getter);
114 LabelAPI addTitle(String text, Color color);
116
117 void addImage(String spriteName, float pad);
118 void addImage(String spriteName, float width, float pad);
120
127
132 void addIcons(CommoditySpecAPI com, int num, IconRenderMode mode);
133 void addIconGroup(float pad);
134 void addIconGroup(float rowHeight, float pad);
136
141 void addIconGroupAndCenter(float pad);
142 void addStatModGrid(float width, float valueWidth, float valuePad, float pad, StatBonus stat, boolean showNonMods, StatModValueGetter getter);
143
151 void showCargo(CargoAPI cargo, int max, boolean sort, float pad);
152 void showShips(List<FleetMemberAPI> ships, int max, boolean sort, float pad);
153
160 UIPanelAPI beginTable(FactionAPI faction, float itemHeight, Object ... columns);
161 UIPanelAPI beginTable2(FactionAPI faction, float itemHeight, boolean withBorder, boolean withHeader, Object ... columns);
162
166 UIPanelAPI beginTable(Color base, Color dark, Color bright, float itemHeight, Object ... columns);
167 UIPanelAPI beginTable(Color base, Color dark, Color bright, float itemHeight, boolean withBorder, boolean withHeader, Object ... columns);
168
178 Object addRow(Object ... data);
188 Object addRowWithGlow(Object ... data);
189 void addTooltipToAddedRow(TooltipCreator tc, TooltipLocation loc);
190 void addTooltipToAddedRow(TooltipCreator tc, TooltipLocation loc, boolean recreateEveryFrame);
191
192 void addTable(String emptyText, int andMore, float pad);
193 void setGridValueColor(Color valueColor);
194
195 TooltipMakerAPI beginImageWithText(String spriteName, float imageHeight);
197 void addIconGroup(float rowHeight, int rows, float pad);
198 LabelAPI addPara(String format, float pad, Color color, Color hl, String ... highlights);
199
203 ButtonAPI addButton(String text, Object data, float width, float height, float pad);
204 ButtonAPI addButton(String text, Object data, Color base, Color bg, float width, float height, float pad);
205 ButtonAPI addButton(String text, Object data, Color base, Color bg, Alignment align, CutStyle style, float width, float height, float pad);
206 void setBulletedListMode(String itemPrefix);
207 void setBulletWidth(Float bulletWidth);
208
211 void addImage(String spriteName, float width, float height, float pad);
212
214 void setTextWidthOverride(float textWidthOverride);
215 void addImages(float width, float height, float pad, float imagePad, String ... spriteNames);
218 void setGridRowHeight(float gridSize);
219
220 String shortenString(String in, float maxWidth);
221 void addStatModGrid(float width, float valueWidth, float valuePad,
222 float pad, MutableStat stat, boolean showNonMods,
223 StatModValueGetter getter);
224 void addShipList(int cols, int rows, float iconSize, Color baseColor, List<FleetMemberAPI> ships, float pad);
226 LabelAPI addPara(String format, float pad, Color[] hl, String ... highlights);
228 void addStoryPointUseInfo(float pad, float bonusXPFraction, boolean withNoSPNotification);
229 void addStoryPointUseInfo(float pad, int numPoints, float bonusXPFraction, boolean withNoSPNotification);
230
231 void setForceProcessInput(boolean forceProcessInput);
232
233 void addPlaythroughDataPanel(float width, float height);
234 void setBulletColor(Color bulletColor);
235 void addRelationshipBar(PersonAPI person, float pad);
236 void addRelationshipBar(PersonAPI person, float width, float pad);
237 void addRelationshipBar(FactionAPI faction, float pad);
238 void addRelationshipBar(FactionAPI faction, float width, float pad);
239 void addRelationshipBar(float value, float pad);
240 void addRelationshipBar(float value, float width, float pad);
241 void addImportanceIndicator(PersonImportance importance, float width, float pad);
242 void addTooltipToPrevious(TooltipCreator tc, TooltipLocation loc);
243 ButtonAPI addAreaCheckbox(String text, Object data, Color base, Color bg,
244 Color bright, float width, float height, float pad);
245 void showShips(List<FleetMemberAPI> ships, int max, boolean sort, boolean showBaseHullForDHulls, float pad);
247 void showFullSurveyReqs(PlanetAPI planet, boolean withText, float pad);
248 void showCost(String title, boolean withAvailable, float widthOverride, Color color, Color dark, float pad,
249 String[] res, int[] quantities, boolean[] consumed);
250 void showCost(String title, boolean withAvailable, Color color, Color dark, float pad, String[] res,
251 int[] quantities);
252 void showCost(Color color, Color dark, float pad, String[] res, int[] quantities);
253 void showCost(String title, boolean withAvailable, float widthOverride, float heightOverride, Color color,
254 Color dark, float pad, String[] res, int[] quantities, boolean[] consumed);
256 ButtonAPI addAreaCheckbox(String text, Object data, Color base, Color bg, Color bright, float width, float height,
257 float pad, boolean leftAlign);
260 float computeStringWidth(String in);
261 TextFieldAPI addTextField(float width, float pad);
262 TextFieldAPI addTextField(float width, String font, float pad);
263 TextFieldAPI addTextField(float width, float height, String font, float pad);
267 @Deprecated ButtonAPI addCheckbox(float width, float height, String text, UICheckboxSize size, float pad);
271 @Deprecated ButtonAPI addCheckbox(float width, float height, String text, String font, Color textColor, UICheckboxSize size,
272 float pad);
273 void setAreaCheckboxFont(String areaCheckboxFont);
275 UIComponentAPI addLabelledValue(String label, String value, Color labelColor, Color valueColor, float width, float pad);
277
284
292
293 UIComponentAPI addEventStageMarker(EventStageDisplayData data);
295 TooltipMakerAPI beginImageWithText(String spriteName, float imageHeight, float widthWithImage, boolean midAlignImage);
296 LabelAPI addSectionHeading(String str, Color textColor, Color bgColor, Alignment align, float width, float pad);
302 void setHeightSoFar(float height);
303
308 UIPanelAPI createSectorMap(float w, float h, MapParams p, String title);
309
314 UIPanelAPI createSectorMap(float w, float h, MapParams p, String title, Color color, Color dark);
316 void addTooltipToPrevious(TooltipCreator tc, TooltipLocation loc, boolean recreateEveryFrame);
317
318
323 LabelAPI createLabel(String str, Color color);
324
329 LabelAPI createLabel(String str, Color color, float maxTextWidth);
330 void addTableHeaderTooltip(int colIndex, TooltipCreator tc);
331 void addTableHeaderTooltip(int colIndex, String text);
332 UIPanelAPI addSectorMap(float w, float h, StarSystemAPI system, float pad);
333 void addTooltipTo(TooltipCreator tc, UIComponentAPI to, TooltipLocation loc);
334 void addTooltipTo(TooltipCreator tc, UIComponentAPI to, TooltipLocation loc, boolean recreateEveryFrame);
335 UIComponentAPI createRect(Color color, float thickness);
336
342 void setIdForAddedRow(Object id);
343
344
346
352
356 void setBgAlpha(float bgAlpha);
357
362
363 void showPlanetInfo(PlanetAPI planet, float pad);
364 void showPlanetInfo(PlanetAPI planet, float w, float h, boolean withName, float pad);
365 void showPlanetInfo(PlanetAPI planet, float w, float h, PlanetInfoParams params, float pad);
366
367 ButtonAPI addCheckbox(float width, float height, String text, Object data, UICheckboxSize size, float pad);
368 ButtonAPI addCheckbox(float width, float height, String text, Object data, String font, Color textColor,
369 UICheckboxSize size, float pad);
370 UIComponentAPI addSkillPanel(PersonAPI person, boolean admin, float pad);
371 UIComponentAPI addSkillPanelOneColumn(PersonAPI person, boolean admin, float pad);
372 void addCodexEntries(String title, Set<String> entryIds, boolean sort, float pad);
373
380 void setCodexEntryId(String codexEntryId);
384 //UIPanelAPI beginTable(float itemHeight, Object[] columns);
385 LabelAPI addParaWithMarkup(String str, float pad);
386 LabelAPI addParaWithMarkup(String str, Color color, float pad);
387 LabelAPI addParaWithMarkup(String str, float pad, String... tokens);
388
403 LabelAPI addParaWithMarkup(String str, Color color, float pad, String... tokens);
404 void showCargo(CargoAPI cargo, int max, boolean sort, float pad, float itemHeight, float itemPad);
405
406
413 void setActionListenerDelegate(ActionListenerDelegate delegate);
414
415 //LabelAPI addParaWithIndent(String text, Color color, float indent, String format, float pad, Color hl, String... highlights);
416}
417
418
419
420
void createTooltip(TooltipMakerAPI tooltip, boolean expanded, Object tooltipParam)
void showCargo(CargoAPI cargo, int max, boolean sort, float pad, float itemHeight, float itemPad)
void showCost(String title, boolean withAvailable, Color color, Color dark, float pad, String[] res, int[] quantities)
LabelAPI addParaWithMarkup(String str, Color color, float pad)
void addTable(String emptyText, int andMore, float pad)
void addTooltipToPrevious(TooltipCreator tc, TooltipLocation loc)
void addImages(float width, float height, float pad, float imagePad, String ... spriteNames)
UIPanelAPI beginTable(Color base, Color dark, Color bright, float itemHeight, boolean withBorder, boolean withHeader, Object ... columns)
void addTableHeaderTooltip(int colIndex, TooltipCreator tc)
UIComponentAPI addEventStageMarker(EventStageDisplayData data)
LabelAPI addPara(String str, float pad)
Object addToGrid(int x, int y, String label, String value, Color valueColor)
String shortenString(String in, float maxWidth)
void addStatModGrid(float width, float valueWidth, float valuePad, float pad, MutableStat stat)
void addCodexEntries(String title, Set< String > entryIds, boolean sort, float pad)
void addTooltipTo(TooltipCreator tc, UIComponentAPI to, TooltipLocation loc)
LabelAPI addSectionHeading(String str, Color textColor, Color bgColor, Alignment align, float width, float pad)
UIPanelAPI addSectorMap(float w, float h, StarSystemAPI system, float pad)
void setActionListenerDelegate(ActionListenerDelegate delegate)
EventProgressBarAPI addEventProgressBar(BaseEventIntel intel, float pad)
TextFieldAPI addTextField(float width, float height, String font, float pad)
UIPanelAPI beginTable(Color base, Color dark, Color bright, float itemHeight, Object ... columns)
void addStoryPointUseInfo(float pad, float bonusXPFraction, boolean withNoSPNotification)
void showShips(List< FleetMemberAPI > ships, int max, boolean sort, boolean showBaseHullForDHulls, float pad)
UIPanelAPI beginTable2(FactionAPI faction, float itemHeight, boolean withBorder, boolean withHeader, Object ... columns)
void setTitleFontColor(Color titleFontColor)
void setBulletWidth(Float bulletWidth)
LabelAPI createLabel(String str, Color color, float maxTextWidth)
LabelAPI createLabel(String str, Color color)
void addImage(String spriteName, float pad)
void addTooltipToAddedRow(TooltipCreator tc, TooltipLocation loc, boolean recreateEveryFrame)
void addShipList(int cols, int rows, float iconSize, Color baseColor, List< FleetMemberAPI > ships, float pad)
LabelAPI addSectionHeading(String str, Color textColor, Color bgColor, Alignment align, float pad)
void setBulletColor(Color bulletColor)
Object addToGrid(int x, int y, String label, String value)
void addStatModGrid(float width, float valueWidth, float valuePad, float pad, StatBonus stat)
void addIconGroup(float rowHeight, int rows, float pad)
UIComponentAPI addCustom(UIComponentAPI comp, float pad)
void beginGrid(float itemWidth, int cols)
LabelAPI addTitle(String text, Color color)
void addStatGridForShips(float width, float valueWidth, float valuePad, float pad, CampaignFleetAPI fleet, int maxNum, boolean ascending, FleetMemberValueGetter getter)
LabelAPI addPara(String str, Color color, float pad)
void addIcons(CommodityOnMarketAPI com, int num, IconRenderMode mode)
void setCodexEntryFleetMember(FleetMemberAPI member)
void addRelationshipBar(PersonAPI person, float pad)
void showCost(Color color, Color dark, float pad, String[] res, int[] quantities)
void addImportanceIndicator(PersonImportance importance, float width, float pad)
void addStatModGrid(float width, float valueWidth, float valuePad, float pad, MutableStat stat, StatModValueGetter getter)
void showShips(List< FleetMemberAPI > ships, int max, boolean sort, float pad)
LabelAPI addPara(String format, float pad, Color[] hl, String ... highlights)
void beginGridFlipped(float itemWidth, int cols, Color labelColor, float valueWidth, float valuePad)
void setExternalScroller(ScrollPanelAPI scroller)
void addStatModGrid(float width, float valueWidth, float valuePad, float pad, MutableStat stat, boolean showNonMods, StatModValueGetter getter)
ButtonAPI addAreaCheckbox(String text, Object data, Color base, Color bg, Color bright, float width, float height, float pad)
void setTitleFont(String titleFont)
UIComponentAPI addSkillPanelOneColumn(PersonAPI person, boolean admin, float pad)
UIPanelAPI beginTable(FactionAPI faction, float itemHeight, Object ... columns)
ButtonAPI addAreaCheckbox(String text, Object data, Color base, Color bg, Color bright, float width, float height, float pad, boolean leftAlign)
TextFieldAPI addTextField(float width, float pad)
void addRelationshipBar(FactionAPI faction, float width, float pad)
LabelAPI addPara(String format, float pad, Color hl, String... highlights)
ButtonAPI addButton(String text, Object data, Color base, Color bg, Alignment align, CutStyle style, float width, float height, float pad)
UIComponentAPI addSpacer(float height)
void setTextWidthOverride(float textWidthOverride)
LabelAPI addParaWithMarkup(String str, float pad, String... tokens)
ButtonAPI addButton(String text, Object data, float width, float height, float pad)
void addIcons(CommoditySpecAPI com, int num, IconRenderMode mode)
void addPlaythroughDataPanel(float width, float height)
UIComponentAPI addEventProgressMarker(BaseEventIntel intel)
ButtonAPI addCheckbox(float width, float height, String text, String font, Color textColor, UICheckboxSize size, float pad)
void addTooltipToPrevious(TooltipCreator tc, TooltipLocation loc, boolean recreateEveryFrame)
void addTooltipTo(TooltipCreator tc, UIComponentAPI to, TooltipLocation loc, boolean recreateEveryFrame)
void addImage(String spriteName, float width, float height, float pad)
ButtonAPI addCheckbox(float width, float height, String text, Object data, UICheckboxSize size, float pad)
void addStatModGrid(float width, float valueWidth, float valuePad, float pad, StatBonus stat, boolean showNonMods, StatModValueGetter getter)
TooltipMakerAPI beginImageWithText(String spriteName, float imageHeight)
UIComponentAPI addSkillPanel(PersonAPI person, float pad)
LabelAPI addPara(String format, float pad, Color color, Color hl, String ... highlights)
void setParaFontColor(Color paraFontColor)
UIPanelAPI createSectorMap(float w, float h, MapParams p, String title)
void setAreaCheckboxFont(String areaCheckboxFont)
TooltipMakerAPI beginImageWithText(String spriteName, float imageHeight, float widthWithImage, boolean midAlignImage)
Object addRowWithGlow(Object ... data)
void showPlanetInfo(PlanetAPI planet, float w, float h, boolean withName, float pad)
LabelAPI addSectionHeading(String str, Alignment align, float pad)
void beginGrid(float itemWidth, int cols, Color labelColor)
void setForceProcessInput(boolean forceProcessInput)
void addRelationshipBar(FactionAPI faction, float pad)
void addIconGroup(float rowHeight, float pad)
ButtonAPI addCheckbox(float width, float height, String text, Object data, String font, Color textColor, UICheckboxSize size, float pad)
TextFieldAPI addTextField(float width, String font, float pad)
UIComponentAPI addSkillPanelOneColumn(PersonAPI person, float pad)
void showPlanetInfo(PlanetAPI planet, float w, float h, PlanetInfoParams params, float pad)
void addImage(String spriteName, float width, float pad)
void beginGridFlipped(float itemWidth, int cols, float valueWidth, float valuePad)
void setCodexTempEntry(CodexEntryPlugin tempCodexEntry)
ButtonAPI addCheckbox(float width, float height, String text, UICheckboxSize size, float pad)
LabelAPI addParaWithMarkup(String str, float pad)
void addRelationshipBar(float value, float pad)
TooltipMakerAPI beginSubTooltip(float width)
UIComponentAPI addSkillPanel(PersonAPI person, boolean admin, float pad)
void addRelationshipBar(float value, float width, float pad)
void setGridLabelColor(Color nameColor)
void addTooltipToAddedRow(TooltipCreator tc, TooltipLocation loc)
void showFullSurveyReqs(PlanetAPI planet, boolean withText, float pad)
void setCodexEntryId(String codexEntryId)
UIComponentAPI addLabelledValue(String label, String value, Color labelColor, Color valueColor, float width, float pad)
UIComponentAPI createRect(Color color, float thickness)
void showCargo(CargoAPI cargo, int max, boolean sort, float pad)
UIComponentAPI addCustomDoNotSetPosition(UIComponentAPI comp)
LabelAPI addParaWithMarkup(String str, Color color, float pad, String... tokens)
UIPanelAPI addImageWithText(float pad)
void addRelationshipBar(PersonAPI person, float width, float pad)
void showCost(String title, boolean withAvailable, float widthOverride, Color color, Color dark, float pad, String[] res, int[] quantities, boolean[] consumed)
void showPlanetInfo(PlanetAPI planet, float pad)
void addStatModGrid(float width, float valueWidth, float valuePad, float pad, StatBonus stat, StatModValueGetter getter)
void showCost(String title, boolean withAvailable, float widthOverride, float heightOverride, Color color, Color dark, float pad, String[] res, int[] quantities, boolean[] consumed)
void addTableHeaderTooltip(int colIndex, String text)
void setGridValueColor(Color valueColor)
void addStoryPointUseInfo(float pad, int numPoints, float bonusXPFraction, boolean withNoSPNotification)
ButtonAPI addButton(String text, Object data, Color base, Color bg, float width, float height, float pad)
UIPanelAPI createSectorMap(float w, float h, MapParams p, String title, Color color, Color dark)
void setBulletedListMode(String itemPrefix)