Starsector API
Loading...
Searching...
No Matches
TooltipMakerAPI.java
Go to the documentation of this file.
1package com.fs.starfarer.api.ui;
2
3import java.awt.Color;
4import java.util.List;
5
6import com.fs.starfarer.api.campaign.CampaignFleetAPI;
7import com.fs.starfarer.api.campaign.CargoAPI;
8import com.fs.starfarer.api.campaign.FactionAPI;
9import com.fs.starfarer.api.campaign.PersonImportance;
10import com.fs.starfarer.api.campaign.PlanetAPI;
11import com.fs.starfarer.api.campaign.StarSystemAPI;
12import com.fs.starfarer.api.campaign.econ.CommodityOnMarketAPI;
13import com.fs.starfarer.api.characters.PersonAPI;
14import com.fs.starfarer.api.combat.MutableStat;
15import com.fs.starfarer.api.combat.MutableStat.StatMod;
16import com.fs.starfarer.api.combat.StatBonus;
17import com.fs.starfarer.api.fleet.FleetMemberAPI;
18import com.fs.starfarer.api.impl.campaign.intel.events.BaseEventIntel;
19import com.fs.starfarer.api.impl.campaign.intel.events.BaseEventIntel.EventStageDisplayData;
20import com.fs.starfarer.api.ui.ButtonAPI.UICheckboxSize;
21
22
23
31public interface TooltipMakerAPI extends UIPanelAPI {
32
33 public static enum TooltipLocation {
34 LEFT,
35 RIGHT,
36 ABOVE,
37 BELOW;
38 }
39
40 public interface TooltipCreator {
41 boolean isTooltipExpandable(Object tooltipParam);
42 float getTooltipWidth(Object tooltipParam);
43 void createTooltip(TooltipMakerAPI tooltip, boolean expanded, Object tooltipParam);
44 }
45
46 public interface StatModValueGetter {
47 String getFlatValue(StatMod mod);
48 String getPercentValue(StatMod mod);
49 String getMultValue(StatMod mod);
50 Color getModColor(StatMod mod);
51 }
52
53 public interface FleetMemberValueGetter {
54 boolean skipMember(FleetMemberAPI member);
55 float getValue(FleetMemberAPI member);
56 String getDisplayValue(FleetMemberAPI member);
57 Color getValueColor(FleetMemberAPI member);
58 }
59
60 LabelAPI addTitle(String text);
61 void setTitleFont(String titleFont);
63 void setTitleFontColor(Color titleFontColor);
64
65 void setParaFont(String paraFont);
66 void setParaFontColor(Color paraFontColor);
68
69 LabelAPI addPara(String format, float pad, Color hl, String... highlights);
70 LabelAPI addPara(String str, float pad);
71 LabelAPI addPara(String str, Color color, float pad);
72 LabelAPI addSectionHeading(String str, Alignment align, float pad);
73 LabelAPI addSectionHeading(String str, Color textColor, Color bgColor, Alignment align, float pad);
74
75 void beginGrid(float itemWidth, int cols);
76 void beginGrid(float itemWidth, int cols, Color labelColor);
77 Object addToGrid(int x, int y, String label, String value);
78 Object addToGrid(int x, int y, String label, String value, Color valueColor);
79 void setGridLabelColor(Color nameColor);
80 void addGrid(float pad);
81 void beginGridFlipped(float itemWidth, int cols, float valueWidth, float valuePad);
82 void beginGridFlipped(float itemWidth, int cols, Color labelColor, float valueWidth, float valuePad);
83 void addStatModGrid(float width, float valueWidth, float valuePad, float pad, MutableStat stat);
84 void addStatModGrid(float width, float valueWidth, float valuePad, float pad, StatBonus stat);
85 void addStatGridForShips(float width, float valueWidth, float valuePad, float pad,
86 CampaignFleetAPI fleet, int maxNum, boolean ascending,
89 void setGridFont(String gridFont);
90 void addStatModGrid(float width, float valueWidth, float valuePad,
91 float pad, MutableStat stat, StatModValueGetter getter);
92 void addStatModGrid(float width, float valueWidth, float valuePad,
93 float pad, StatBonus stat, StatModValueGetter getter);
95 LabelAPI addTitle(String text, Color color);
97
98 void addImage(String spriteName, float pad);
99 void addImage(String spriteName, float width, float pad);
101
108
112 void addIcons(CommodityOnMarketAPI com, int num, IconRenderMode mode);
113 void addIconGroup(float pad);
114 void addIconGroup(float rowHeight, float pad);
116
121 void addIconGroupAndCenter(float pad);
122 void addStatModGrid(float width, float valueWidth, float valuePad, float pad, StatBonus stat, boolean showNonMods, StatModValueGetter getter);
123
131 void showCargo(CargoAPI cargo, int max, boolean sort, float pad);
132 void showShips(List<FleetMemberAPI> ships, int max, boolean sort, float pad);
133
140 UIPanelAPI beginTable(FactionAPI faction, float itemHeight, Object ... columns);
141 UIPanelAPI beginTable2(FactionAPI faction, float itemHeight, boolean withBorder, boolean withHeader, Object ... columns);
142
146 UIPanelAPI beginTable(Color base, Color dark, Color bright, float itemHeight, Object ... columns);
147 UIPanelAPI beginTable(Color base, Color dark, Color bright, float itemHeight, boolean withBorder, boolean withHeader, Object ... columns);
148
158 Object addRow(Object ... data);
168 Object addRowWithGlow(Object ... data);
169 void addTooltipToAddedRow(TooltipCreator tc, TooltipLocation loc);
170 void addTooltipToAddedRow(TooltipCreator tc, TooltipLocation loc, boolean recreateEveryFrame);
171
172 void addTable(String emptyText, int andMore, float pad);
173 void setGridValueColor(Color valueColor);
174
175 TooltipMakerAPI beginImageWithText(String spriteName, float imageHeight);
177 void addIconGroup(float rowHeight, int rows, float pad);
178 LabelAPI addPara(String format, float pad, Color color, Color hl, String ... highlights);
179
183 ButtonAPI addButton(String text, Object data, float width, float height, float pad);
184 ButtonAPI addButton(String text, Object data, Color base, Color bg, float width, float height, float pad);
185 ButtonAPI addButton(String text, Object data, Color base, Color bg, Alignment align, CutStyle style, float width, float height, float pad);
186 void setBulletedListMode(String itemPrefix);
187 void setBulletWidth(Float bulletWidth);
188
191 void addImage(String spriteName, float width, float height, float pad);
192
194 void setTextWidthOverride(float textWidthOverride);
195 void addImages(float width, float height, float pad, float imagePad, String ... spriteNames);
198 void setGridRowHeight(float gridSize);
199
200 String shortenString(String in, float maxWidth);
201 void addStatModGrid(float width, float valueWidth, float valuePad,
202 float pad, MutableStat stat, boolean showNonMods,
203 StatModValueGetter getter);
204 void addShipList(int cols, int rows, float iconSize, Color baseColor, List<FleetMemberAPI> ships, float pad);
206 LabelAPI addPara(String format, float pad, Color[] hl, String ... highlights);
208 void addStoryPointUseInfo(float pad, float bonusXPFraction, boolean withNoSPNotification);
209 void addStoryPointUseInfo(float pad, int numPoints, float bonusXPFraction, boolean withNoSPNotification);
210
211 void setForceProcessInput(boolean forceProcessInput);
212
213 void addPlaythroughDataPanel(float width, float height);
214 void setBulletColor(Color bulletColor);
215 void addRelationshipBar(PersonAPI person, float pad);
216 void addRelationshipBar(PersonAPI person, float width, float pad);
217 void addRelationshipBar(FactionAPI faction, float pad);
218 void addRelationshipBar(FactionAPI faction, float width, float pad);
219 void addRelationshipBar(float value, float pad);
220 void addRelationshipBar(float value, float width, float pad);
221 void addImportanceIndicator(PersonImportance importance, float width, float pad);
222 void addTooltipToPrevious(TooltipCreator tc, TooltipLocation loc);
223 ButtonAPI addAreaCheckbox(String text, Object data, Color base, Color bg,
224 Color bright, float width, float height, float pad);
225 void showShips(List<FleetMemberAPI> ships, int max, boolean sort, boolean showBaseHullForDHulls, float pad);
227 void showFullSurveyReqs(PlanetAPI planet, boolean withText, float pad);
228 void showCost(String title, boolean withAvailable, float widthOverride, Color color, Color dark, float pad,
229 String[] res, int[] quantities, boolean[] consumed);
230 void showCost(String title, boolean withAvailable, Color color, Color dark, float pad, String[] res,
231 int[] quantities);
232 void showCost(Color color, Color dark, float pad, String[] res, int[] quantities);
234 ButtonAPI addAreaCheckbox(String text, Object data, Color base, Color bg, Color bright, float width, float height,
235 float pad, boolean leftAlign);
236 UIComponentAPI addSkillPanel(PersonAPI person, float pad);
237 UIComponentAPI addSkillPanelOneColumn(PersonAPI person, float pad);
238 float computeStringWidth(String in);
239 TextFieldAPI addTextField(float width, float pad);
240 TextFieldAPI addTextField(float width, String font, float pad);
241 TextFieldAPI addTextField(float width, float height, String font, float pad);
245 @Deprecated ButtonAPI addCheckbox(float width, float height, String text, UICheckboxSize size, float pad);
249 @Deprecated ButtonAPI addCheckbox(float width, float height, String text, String font, Color textColor, UICheckboxSize size,
250 float pad);
251 void setAreaCheckboxFont(String areaCheckboxFont);
253 UIComponentAPI addLabelledValue(String label, String value, Color labelColor, Color valueColor, float width, float pad);
255
261 EventProgressBarAPI addEventProgressBar(BaseEventIntel intel, float pad);
262
270
271 UIComponentAPI addEventStageMarker(EventStageDisplayData data);
273 TooltipMakerAPI beginImageWithText(String spriteName, float imageHeight, float widthWithImage, boolean midAlignImage);
274 LabelAPI addSectionHeading(String str, Color textColor, Color bgColor, Alignment align, float width, float pad);
280 void setHeightSoFar(float height);
281
286 UIPanelAPI createSectorMap(float w, float h, MapParams p, String title);
287
292 UIPanelAPI createSectorMap(float w, float h, MapParams p, String title, Color color, Color dark);
294 void addTooltipToPrevious(TooltipCreator tc, TooltipLocation loc, boolean recreateEveryFrame);
295
296
301 LabelAPI createLabel(String str, Color color);
302
307 LabelAPI createLabel(String str, Color color, float maxTextWidth);
308 void addTableHeaderTooltip(int colIndex, TooltipCreator tc);
309 void addTableHeaderTooltip(int colIndex, String text);
310 UIPanelAPI addSectorMap(float w, float h, StarSystemAPI system, float pad);
311 void addTooltipTo(TooltipCreator tc, UIComponentAPI to, TooltipLocation loc);
312 void addTooltipTo(TooltipCreator tc, UIComponentAPI to, TooltipLocation loc, boolean recreateEveryFrame);
313 UIComponentAPI createRect(Color color, float thickness);
314
320 void setIdForAddedRow(Object id);
321
322
324
330
334 void setBgAlpha(float bgAlpha);
335
340
341 void showPlanetInfo(PlanetAPI planet, float pad);
342 void showPlanetInfo(PlanetAPI planet, float w, float h, boolean withName, float pad);
343
344 ButtonAPI addCheckbox(float width, float height, String text, Object data, UICheckboxSize size, float pad);
345 ButtonAPI addCheckbox(float width, float height, String text, Object data, String font, Color textColor,
346 UICheckboxSize size, float pad);
347 UIComponentAPI addSkillPanel(PersonAPI person, boolean admin, float pad);
348 UIComponentAPI addSkillPanelOneColumn(PersonAPI person, boolean admin, float pad);
349
350 //UIPanelAPI beginTable(float itemHeight, Object[] columns);
351
352 //LabelAPI addParaWithIndent(String text, Color color, float indent, String format, float pad, Color hl, String... highlights);
353}
354
355
356
357
void createTooltip(TooltipMakerAPI tooltip, boolean expanded, Object tooltipParam)
void showCost(String title, boolean withAvailable, Color color, Color dark, float pad, String[] res, int[] quantities)
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 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)
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 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)
ButtonAPI addButton(String text, Object data, float width, float height, float pad)
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 addImage(String spriteName, float width, float pad)
void beginGridFlipped(float itemWidth, int cols, float valueWidth, float valuePad)
ButtonAPI addCheckbox(float width, float height, String text, UICheckboxSize size, 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)
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)
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 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)