24 String [] array =
new String[params.length];
26 for (String curr : params) {
29 if (ind ==
null)
continue;
30 list += ind.getName() +
", ";
31 array[i] = ind.getName();
34 if (!list.isEmpty()) {
35 list = list.substring(0, list.length() - 2);
36 tooltip.addPara(list, pad,
37 Misc.getGrayColor(), Misc.getBasePlayerColor(), array);
43 public static void addReqsSection(Industry industry, InstallableItemEffect effect, TooltipMakerAPI tooltip,
boolean withRequiresText,
float pad) {
44 List<String> reqs = effect.getRequirements(industry);
45 List<String> unmet = effect.getUnmetRequirements(industry);
47 if (reqs ==
null) reqs =
new ArrayList<String>();
48 if (unmet ==
null) unmet =
new ArrayList<String>();
50 Color [] hl =
new Color[reqs.size()];
54 for (String curr : reqs) {
57 if (unmet.contains(curr)) {
58 hl[i] = Misc.getNegativeHighlightColor();
60 hl[i] = Misc.getBasePlayerColor();
66 if (!list.isEmpty()) {
67 list = list.substring(0, list.length() - 2);
68 list = Misc.ucFirst(list);
69 reqs.set(0, Misc.ucFirst(reqs.get(0)));
71 float bulletWidth = 70f;
72 if (withRequiresText) {
73 tooltip.setBulletWidth(bulletWidth);
74 tooltip.setBulletColor(Misc.getGrayColor());
75 tooltip.setBulletedListMode(
"Requires:");
78 LabelAPI label = tooltip.addPara(list, Misc.getGrayColor(), pad);
79 label.setHighlightColors(hl);
80 label.setHighlight(reqs.toArray(
new String[0]));
82 if (withRequiresText) {
83 tooltip.setBulletedListMode(
null);
98 LabelAPI design = Misc.addDesignTypePara(tooltip,
getDesignType(), opad);
100 float bulletWidth = 70f;
101 if (design !=
null) {
102 bulletWidth = design.computeTextWidth(
"Design type: ");
105 InstallableItemEffect effect = ItemEffectsRepo.ITEM_EFFECTS.get(
getId());
106 if (effect !=
null) {
107 tooltip.setBulletWidth(bulletWidth);
108 tooltip.setBulletColor(Misc.getGrayColor());
110 tooltip.setBulletedListMode(
"Installed in:");
112 tooltip.setBulletedListMode(
"Requires:");
115 tooltip.setBulletedListMode(
null);
118 Color c = Misc.getTextColor();
122 effect.addItemDescription(
null, tooltip,
new SpecialItemData(
getId(),
null), InstallableItemDescriptionMode.CARGO_TOOLTIP);
125 Color c = Misc.getTextColor();
131 addCostLabel(tooltip, opad, transferHandler, stackSource);