1package com.fs.starfarer.api.impl.codex;
3import java.util.ArrayList;
4import java.util.Collections;
5import java.util.Comparator;
6import java.util.HashMap;
7import java.util.HashSet;
8import java.util.LinkedHashMap;
9import java.util.LinkedHashSet;
17import org.json.JSONException;
19import com.fs.starfarer.api.Global;
20import com.fs.starfarer.api.ModPlugin;
21import com.fs.starfarer.api.ModSpecAPI;
22import com.fs.starfarer.api.campaign.CargoAPI.CargoItemType;
23import com.fs.starfarer.api.campaign.CargoStackAPI;
24import com.fs.starfarer.api.campaign.PlanetSpecAPI;
25import com.fs.starfarer.api.campaign.SpecialItemPlugin;
26import com.fs.starfarer.api.campaign.SpecialItemSpecAPI;
27import com.fs.starfarer.api.campaign.econ.CommoditySpecAPI;
28import com.fs.starfarer.api.campaign.impl.items.MultiBlueprintItemPlugin;
29import com.fs.starfarer.api.characters.MarketConditionSpecAPI;
30import com.fs.starfarer.api.characters.MutableCharacterStatsAPI.SkillLevelAPI;
31import com.fs.starfarer.api.characters.SkillSpecAPI;
32import com.fs.starfarer.api.combat.DamageType;
33import com.fs.starfarer.api.combat.ShipAPI;
34import com.fs.starfarer.api.combat.ShipAPI.HullSize;
35import com.fs.starfarer.api.combat.ShipHullSpecAPI;
36import com.fs.starfarer.api.combat.ShipHullSpecAPI.ShipTypeHints;
37import com.fs.starfarer.api.combat.ShipSystemSpecAPI;
38import com.fs.starfarer.api.combat.ShipVariantAPI;
39import com.fs.starfarer.api.combat.WeaponAPI.AIHints;
40import com.fs.starfarer.api.combat.WeaponAPI.WeaponSize;
41import com.fs.starfarer.api.combat.WeaponAPI.WeaponType;
42import com.fs.starfarer.api.fleet.FleetMemberAPI;
43import com.fs.starfarer.api.fleet.FleetMemberType;
44import com.fs.starfarer.api.impl.SharedUnlockData;
45import com.fs.starfarer.api.impl.campaign.econ.ResourceDepositsCondition;
46import com.fs.starfarer.api.impl.campaign.econ.impl.InstallableItemEffect;
47import com.fs.starfarer.api.impl.campaign.econ.impl.ItemEffectsRepo;
48import com.fs.starfarer.api.impl.campaign.ids.Abilities;
49import com.fs.starfarer.api.impl.campaign.ids.Commodities;
50import com.fs.starfarer.api.impl.campaign.ids.Conditions;
51import com.fs.starfarer.api.impl.campaign.ids.HullMods;
52import com.fs.starfarer.api.impl.campaign.ids.Industries;
53import com.fs.starfarer.api.impl.campaign.ids.Items;
54import com.fs.starfarer.api.impl.campaign.ids.Planets;
55import com.fs.starfarer.api.impl.campaign.ids.ShipSystems;
56import com.fs.starfarer.api.impl.campaign.ids.Skills;
57import com.fs.starfarer.api.impl.campaign.ids.Tags;
58import com.fs.starfarer.api.impl.combat.threat.EnergyLashActivatedSystem;
59import com.fs.starfarer.api.loading.AbilitySpecAPI;
60import com.fs.starfarer.api.loading.Description;
61import com.fs.starfarer.api.loading.Description.Type;
62import com.fs.starfarer.api.loading.FighterWingSpecAPI;
63import com.fs.starfarer.api.loading.HullModSpecAPI;
64import com.fs.starfarer.api.loading.IndustrySpecAPI;
65import com.fs.starfarer.api.loading.WeaponSlotAPI;
66import com.fs.starfarer.api.loading.WeaponSpecAPI;
67import com.fs.starfarer.api.loading.WingRole;
68import com.fs.starfarer.api.loading.WithSourceMod;
69import com.fs.starfarer.api.ui.CustomPanelAPI;
70import com.fs.starfarer.api.ui.TagDisplayAPI;
71import com.fs.starfarer.api.ui.TooltipMakerAPI;
72import com.fs.starfarer.api.ui.UIPanelAPI;
73import com.fs.starfarer.api.util.CountingMap;
74import com.fs.starfarer.api.util.ListMap;
75import com.fs.starfarer.api.util.Misc;
85 public static Map<String, CodexEntryPlugin>
ENTRIES =
new LinkedHashMap<>();
161 public static String
SMALL =
"Small";
163 public static String
LARGE =
"Large";
173 public static String
BEAM =
"Beam";
178 public static String
OTHER =
"Other";
180 public static String
DMODS =
"D-mods";
184 public static String
STARS =
"Stars";
188 public static String
COLONY =
"Colony items";
206 plugin.onAboutToStartGeneratingCodex();
280 plugin.onAboutToLinkCodexEntries();
295 plugin.onCodexDataGenerated();
303 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
307 public boolean isVisible() {
311 public boolean isLocked() {
315 public boolean hasCustomDetailPanel() {
322 float horzBoxPad = 30f;
324 float tw = width - 290f - opad - horzBoxPad + 10f;
328 text.
addPara(
"UNKNOWN ENTRY\n\nPlease register your Tri-Tachyon datapad to receive the latest news and updates.", 0f);
332 if (relatedEntries !=
null) {
337 if (relatedEntries !=
null) {
351 entry.
setParam(
"Has to be set to something for detail to show; "
352 +
"usually this is the data for what the entry is about");
364 if (seen ==
null) seen =
new LinkedHashSet<>();
365 if (seen.contains(root))
return;
368 if (!cat.isCategory())
continue;
370 if (sort ==
null) sort = 1000f;
371 cat.setCategorySortTierForRelatedEntries(sort);
379 public boolean hasTagDisplay() {
392 if (!curr.isVisible() || curr.isLocked() || curr.skipForTags())
continue;
408 if (dmods > 0) types.
add(
DMODS, dmods);
415 List<String> keys =
new ArrayList<String>(techs.keySet());
416 Collections.sort(keys);
417 for (String tech : keys) {
425 keys =
new ArrayList<String>(types.keySet());
426 Collections.sort(keys);
427 for (String type : keys) {
443 public boolean hasCustomDetailPanel() {
448 public boolean hasDetail() {
466 float horzBoxPad = 30f;
470 float tw = width - 290f - opad - horzBoxPad + 10f;
475 text.
addPara(
"Spacer's manual description test.", 0f);
481 if (relatedEntries !=
null) {
486 if (relatedEntries !=
null) {
516 public boolean hasTagDisplay() {
527 if (!curr.isVisible() || curr.isLocked() || curr.skipForTags())
continue;
554 public boolean hasTagDisplay() {
565 if (!curr.isVisible() || curr.isLocked() || curr.skipForTags())
continue;
594 public boolean hasTagDisplay() {
603 if (!curr.isVisible() || curr.isLocked() || curr.skipForTags())
continue;
626 public boolean hasTagDisplay() {
639 if (!curr.isVisible() || curr.isLocked() || curr.skipForTags())
continue;
647 }
else if (spec.
isStar()) {
676 public boolean hasTagDisplay() {
685 if (!curr.isVisible() || curr.isLocked() || curr.skipForTags())
continue;
694 types.
add(
"Special");
701 List<String> keys =
new ArrayList<String>(types.keySet());
702 Collections.sort(keys);
703 for (String type : keys) {
718 public boolean hasTagDisplay() {
732 if (!curr.isVisible() || curr.isLocked() || curr.skipForTags())
continue;
747 if (!techs.isEmpty()) {
749 List<String> keys =
new ArrayList<String>(techs.keySet());
750 Collections.sort(keys);
751 for (String tech : keys) {
780 public boolean hasTagDisplay() {
807 if (!curr.isVisible() || curr.isLocked() || curr.skipForTags())
continue;
812 if (spec.
getAIHints().contains(AIHints.SYSTEM) &&
817 if (spec.
getSize() == WeaponSize.SMALL) small++;
818 else if (spec.
getSize() == WeaponSize.MEDIUM) medium++;
819 else if (spec.
getSize() == WeaponSize.LARGE) large++;
822 if (spec.
getType() == WeaponType.BALLISTIC) ballistic++;
823 else if (spec.
getType() == WeaponType.MISSILE) missile++;
824 else if (spec.
getType() == WeaponType.ENERGY) energy++;
827 else if (spec.
getMountType() == WeaponType.COMPOSITE) composite++;
828 else if (spec.
getMountType() == WeaponType.SYNERGY) synergy++;
829 else if (spec.
getMountType() == WeaponType.UNIVERSAL) universal++;
837 if (spec.
isBeam()) beam++;
845 if (!techs.isEmpty()) {
847 List<String> keys =
new ArrayList<String>(techs.keySet());
848 Collections.sort(keys);
849 for (String tech : keys) {
895 public boolean hasTagDisplay() {
906 if (!(curr.getParam() instanceof
SkillSpecAPI))
continue;
907 if (!curr.isVisible() || curr.isLocked() || curr.skipForTags())
continue;
911 if (!apt.isEmpty()) apts.
add(apt);
913 if (spec.
isElite()) personal++;
922 if (!apts.isEmpty()) {
924 List<String> keys =
new ArrayList<String>(apts.keySet());
925 Collections.sort(keys);
926 for (String tech : keys) {
953 public boolean hasTagDisplay() {
973 if (!curr.isVisible() || curr.isLocked() || curr.skipForTags())
continue;
975 boolean station =
false;
983 boolean isPhase = spec.
isPhase() || spec.
getHints().contains(ShipTypeHints.PHASE);
988 else if (isPhase) phase++;
989 else if (!station) combat++;
993 if (station) stations++;
994 else if (spec.
getHullSize() == HullSize.FRIGATE) frigate++;
995 else if (spec.
getHullSize() == HullSize.DESTROYER) destroyer++;
996 else if (spec.
getHullSize() == HullSize.CRUISER) cruiser++;
997 else if (spec.
getHullSize() == HullSize.CAPITAL_SHIP) capital++;
1005 if (!counts.isEmpty()) {
1007 List<String> keys =
new ArrayList<String>(counts.keySet());
1008 Collections.sort(keys);
1009 for (String tech : keys) {
1046 public boolean hasTagDisplay() {
1056 if (!curr.isVisible() || curr.isLocked() || curr.skipForTags())
continue;
1063 if (!counts.isEmpty()) {
1065 List<String> keys =
new ArrayList<String>(counts.keySet());
1066 Collections.sort(keys);
1067 for (String tech : keys) {
1084 if (spec.getHints().contains(ShipTypeHints.HIDE_IN_CODEX))
continue;
1086 if (spec.isDefaultDHull())
continue;
1087 if (spec.getHullId().equals(
"shuttlepod"))
continue;
1089 boolean station = spec.getHints().contains(ShipTypeHints.STATION);
1090 String name = spec.getHullNameWithDashClass();
1091 String designation =
"";
1092 if (spec.hasDesignation() && !spec.getDesignation().equals(spec.getHullName())) {
1093 designation =
" " + spec.getDesignation().toLowerCase();
1097 name = spec.getHullName();
1100 spec.getHullNameWithDashClass() + designation,
null, spec) {
1102 public String getSortTitle() {
1103 return spec.getHullName();
1106 public String getSearchString() {
1108 return super.getSearchString() +
" Station";
1110 return super.getSearchString();
1113 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
1116 if (mode == ListMode.RELATED_ENTRIES) {
1119 }
else if (spec.hasDesignation() && !spec.getDesignation().equals(spec.getHullName())) {
1125 public boolean matchesTags(Set<String> tags) {
1126 HullSize size = spec.getHullSize();
1132 String m = spec.getManufacturer();
1133 if (m !=
null && !tags.contains(m) && !tags.contains(
ALL_TECHS))
return false;
1140 String sizeTag =
null;
1141 if (size == HullSize.FRIGATE) sizeTag =
FRIGATES;
1142 if (size == HullSize.DESTROYER) sizeTag =
DESTROYERS;
1143 if (size == HullSize.CRUISER) sizeTag =
CRUISERS;
1144 if (size == HullSize.CAPITAL_SHIP) sizeTag =
CAPITALS;
1146 if (sizeTag !=
null && !tags.contains(sizeTag))
return false;
1148 boolean isPhase = spec.isPhase() || spec.getHints().contains(ShipTypeHints.PHASE);
1149 boolean phaseCiv = isPhase && spec.isCivilianNonCarrier();
1150 if (!phaseCiv && isPhase && !tags.contains(
PHASE_SHIPS))
return false;
1151 if (!phaseCiv && spec.isCivilianNonCarrier() && !tags.contains(
CIVILIAN))
return false;
1154 if (spec.isCarrier() && !tags.contains(
CARRIERS))
return false;
1156 boolean combat = !isPhase && !spec.isCarrier() && !spec.isCivilianNonCarrier();
1157 if (combat && !tags.contains(
COMBAT_SHIPS))
return false;
1159 String m = spec.getManufacturer();
1160 if (m !=
null && !tags.contains(m) && !tags.contains(
ALL_TECHS))
return false;
1166 public Set<String> getUnlockRelatedTags() {
1167 return spec.getTags();
1171 public boolean isUnlockedIfRequiresUnlock() {
1181 String variantId = spec.getHullId() +
"_Hull";
1182 if (spec.getCodexVariantId() !=
null && !spec.getCodexVariantId().isBlank()) {
1183 variantId = spec.getCodexVariantId();
1186 if (variant !=
null) {
1188 if (station) parent = stations;
1323 List<CodexEntryPlugin> result =
new ArrayList<>();
1324 Set<String> seenVariants =
new HashSet<>();
1327 if (moduleVariant ==
null)
continue;
1341 String test = moduleVariant.
toJSONObject().toString(4);
1342 if (seenVariants.contains(test))
continue;
1343 seenVariants.add(test);
1344 }
catch (JSONException e) {
1369 moduleEntryId = UUID.randomUUID().toString();
1375 public String getSortTitle() {
1379 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
1384 public boolean matchesTags(Set<String> tags) {
1388 public boolean checkTagsWhenLocked() {
1394 public boolean isVisible() {
1398 public boolean isLocked() {
1399 return entryForParentShip.
isLocked();
1402 public String getSearchString() {
1406 public boolean skipForTags() {
1416 if (parent !=
null) parent.
addChild(curr);
1429 spec.getName(), spec.getIconSpriteName(), spec) {
1431 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
1433 if (mode == ListMode.RELATED_ENTRIES) {
1442 public boolean matchesTags(Set<String> tags) {
1443 if (tags.contains(
ALL_TYPES))
return true;
1446 if (!desc.
hasText2()) typeStr =
"Special";
1447 return tags.contains(typeStr);
1451 public boolean isVignetteIcon() {
1456 public Color getIconColor() {
1461 public Set<String> getUnlockRelatedTags() {
1462 LinkedHashSet<String> tags =
new LinkedHashSet<>(spec.getTags());
1468 public boolean isUnlockedIfRequiresUnlock() {
1473 public String getSearchString() {
1474 return super.getSearchString();
1485 for (String skillId : skillIds) {
1489 if (aptitude !=
null && !aptitude.isBlank()) {
1490 aptStr =
" - " + aptitude +
" skill";
1505 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
1507 if (mode == ListMode.RELATED_ENTRIES ||
true) {
1509 if (aptitude !=
null && !aptitude.isBlank()) {
1518 public boolean matchesTags(Set<String> tags) {
1520 if (!spec.
isElite() && !tags.contains(
OTHER))
return false;
1523 if ((aptitude ==
null || aptitude.isBlank()) && !tags.contains(
ALL_APTITUDES)) {
1526 return tags.contains(aptitude);
1530 public boolean isVignetteIcon() {
1535 public Color getIconColor() {
1540 public Set<String> getUnlockRelatedTags() {
1545 public boolean isUnlockedIfRequiresUnlock() {
1550 public String getSearchString() {
1552 return super.getSearchString() +
" " + aptitude;
1562 for (String
id : ids) {
1570 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
1572 if (mode == ListMode.RELATED_ENTRIES) {
1577 public boolean matchesTags(Set<String> tags) {
1578 return super.matchesTags(tags);
1582 public boolean isVignetteIcon() {
1587 public Color getIconColor() {
1592 public Set<String> getUnlockRelatedTags() {
1597 public boolean isUnlockedIfRequiresUnlock() {
1602 public String getSearchString() {
1603 return super.getSearchString();
1614 aptitude =
"AI core";
1622 Collections.sort(skills.
getChildren(),
new Comparator<CodexEntryPlugin>() {
1624 public int compare(CodexEntryPlugin o1, CodexEntryPlugin o2) {
1625 SkillSpecAPI s1 = null;
1626 SkillSpecAPI s2 = null;
1627 if (o1.getParam() instanceof SkillSpecAPI) {
1628 s1 = (SkillSpecAPI) o1.getParam();
1630 if (o2.getParam() instanceof SkillSpecAPI) {
1631 s2 = (SkillSpecAPI) o2.getParam();
1633 if (s1 != null && s2 == null) return Integer.MIN_VALUE;
1634 if (s2 != null && s1 == null) return Integer.MAX_VALUE;
1635 if (s1 == null && s2 == null) return o1.getTitle().compareTo(o2.getTitle());
1639 if (s1.hasTag(Skills.TAG_AI_CORE_ONLY)) tier1 = 5;
1640 if (s2.hasTag(Skills.TAG_AI_CORE_ONLY)) tier2 = 5;
1642 if (tier1 != tier2) return tier1 - tier2;
1644 int diff = s1.getGoverningAptitudeOrder() - s2.getGoverningAptitudeOrder();
1645 if (diff != 0) return diff;
1647 return (int) Math.signum(s1.getOrder() - s2.getOrder());
1658 if ((spec.getAIHints().contains(AIHints.SYSTEM) || spec.getType() == WeaponType.SYSTEM) &&
1659 !(spec.getAIHints().contains(AIHints.SHOW_IN_CODEX) ||
1665 spec.getWeaponName(),
null, spec) {
1667 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
1669 if (mode == ListMode.RELATED_ENTRIES ||
true) {
1670 String size = spec.getSize().getDisplayName();
1671 WeaponType type = spec.getMountType();
1672 if (type ==
null) type = spec.getType();
1680 public boolean matchesTags(Set<String> tags) {
1681 WeaponSize size = spec.getSize();
1683 String sizeTag =
null;
1684 if (size == WeaponSize.SMALL) sizeTag = SMALL;
1685 if (size == WeaponSize.MEDIUM) sizeTag = MEDIUM;
1686 if (size == WeaponSize.LARGE) sizeTag = LARGE;
1687 if (spec.getAIHints().contains(AIHints.SYSTEM) &&
1688 spec.getPrimaryRoleStr() !=
null &&
1689 spec.getPrimaryRoleStr() !=
null &&
1690 spec.getPrimaryRoleStr().endsWith(
"(Fighter)")) {
1691 sizeTag = FIGHTER_WEAPON;
1694 if (sizeTag !=
null && !tags.contains(sizeTag))
return false;
1696 String damTypeTag =
null;
1703 if (damTypeTag !=
null && !tags.contains(damTypeTag))
return false;
1705 String m = spec.getManufacturer();
1706 if (m !=
null && !tags.contains(m) && !tags.contains(ALL_TECHS))
return false;
1709 if (spec.getMountType() == WeaponType.HYBRID && tags.contains(HYBRID))
return true;
1710 if (spec.getMountType() == WeaponType.COMPOSITE && tags.contains(COMPOSITE))
return true;
1711 if (spec.getMountType() == WeaponType.SYNERGY && tags.contains(SYNERGY))
return true;
1712 if (spec.getMountType() == WeaponType.UNIVERSAL && tags.contains(UNIVERSAL))
return true;
1713 if (spec.isBeam() && tags.contains(BEAM))
return true;
1715 if (spec.getType() == WeaponType.BALLISTIC && !tags.contains(BALLISTIC))
return false;
1716 if (spec.getType() == WeaponType.MISSILE && !tags.contains(MISSILE))
return false;
1717 if (spec.getType() == WeaponType.ENERGY && !tags.contains(ENERGY))
return false;
1723 public Set<String> getUnlockRelatedTags() {
1724 return spec.getTags();
1728 public boolean isUnlockedIfRequiresUnlock() {
1740 if (spec.getVariant().getHints().contains(ShipTypeHints.HIDE_IN_CODEX))
continue;
1752 String nameStr2 = nameStr;
1754 nameStr2,
null, spec) {
1756 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
1758 if (mode == ListMode.RELATED_ENTRIES ||
true) {
1759 String role = spec.getRole().name().toLowerCase();
1761 if (spec.getRoleDesc() !=
null && !spec.getRoleDesc().isEmpty()) {
1762 role = spec.getRoleDesc();
1769 public boolean matchesTags(Set<String> tags) {
1771 if (!tags.contains(FIGHTER))
return false;
1773 if (!tags.contains(BOMBER))
return false;
1775 if (!tags.contains(INTERCEPTOR))
return false;
1777 if (!tags.contains(OTHER))
return false;
1780 String m = spec.getVariant().getHullSpec().getManufacturer();
1781 if (m !=
null && !tags.contains(m) && !tags.contains(ALL_TECHS))
return false;
1787 public Set<String> getUnlockRelatedTags() {
1788 return spec.getTags();
1792 public boolean isUnlockedIfRequiresUnlock() {
1801 public static class GalleryEntryData
implements WithSourceMod {
1802 public String sprite;
1811 String cat =
"illustrations";
1821 if (USE_KEY_NAMES_FOR_GALLERY) {
1822 String text = key.replaceAll(
"_",
" ");
1828 GalleryEntryData data =
new GalleryEntryData();
1829 data.sprite = sprite;
1836 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
1838 if (mode == ListMode.RELATED_ENTRIES) {
1843 public boolean isVignetteIcon() {
1847 public boolean isVisible() {
1848 return super.isVisible();
1851 public boolean isLocked() {
1852 if (codexFullyUnlocked())
return false;
1856 return !desc.
getText3().toLowerCase().contains(
"unlocked");
1873 spec.getName(), spec.getIconName(), spec) {
1875 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
1877 if (mode == ListMode.RELATED_ENTRIES) {
1883 public boolean matchesTags(Set<String> tags) {
1886 if (tags.contains(OTHER) && !colony && !bp)
return true;
1887 if (tags.contains(COLONY) && colony)
return true;
1888 if (tags.contains(BLUEPRINTS) && bp)
return true;
1893 public Set<String> getUnlockRelatedTags() {
1894 return spec.getTags();
1898 public boolean isUnlockedIfRequiresUnlock() {
1914 spec.getName(), spec.getIconName(), spec) {
1916 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
1918 if (mode == ListMode.RELATED_ENTRIES) {
1928 public boolean matchesTags(Set<String> tags) {
1931 if (tags.contains(OTHER) && !aiCore)
return true;
1932 if (tags.contains(AI_CORE) && aiCore)
return true;
1935 return super.matchesTags(tags);
1940 public Set<String> getUnlockRelatedTags() {
1941 return spec.getTags();
1945 public boolean isUnlockedIfRequiresUnlock() {
2041 if (spec.isHiddenEverywhere())
continue;
2045 spec.getDisplayName(), spec.getSpriteName(), spec) {
2047 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
2049 if (mode == ListMode.RELATED_ENTRIES) {
2054 public boolean isVignetteIcon() {
2059 public boolean matchesTags(Set<String> tags) {
2060 if (!tags.contains(spec.getManufacturer())) {
2064 if (tags.contains(ALL_TYPES))
return true;
2066 boolean hasATag =
false;
2067 for (String tag : spec.getUITags()) {
2068 if (tags.contains(tag)) hasATag =
true;
2073 if (spec.isHidden() && !spec.hasTag(
Tags.
HULLMOD_DMOD) && tags.contains(INTRINSIC)) {
2076 if (!hasATag)
return false;
2082 public Set<String> getUnlockRelatedTags() {
2083 return spec.getTags();
2087 public boolean isUnlockedIfRequiresUnlock() {
2103 spec.getName(), spec.getImageName(), spec) {
2105 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
2107 if (mode == ListMode.RELATED_ENTRIES ||
true) {
2110 String type =
"Industry";
2111 if (structure) type =
"Structure";
2116 public boolean isVignetteIcon() {
2120 public boolean matchesTags(Set<String> tags) {
2124 if (tags.contains(OTHER) && !industry && !structure && !station)
return true;
2125 if (tags.contains(INDUSTRIES) && industry)
return true;
2126 if (tags.contains(STRUCTURES) && structure && !station)
return true;
2127 if (tags.contains(STATIONS) && station)
return true;
2131 public Set<String> getUnlockRelatedTags() {
2132 return spec.getTags();
2135 public boolean isUnlockedIfRequiresUnlock() {
2150 spec.getName(), spec.getIconTexture(), spec) {
2152 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
2154 String type =
"Planet";
2155 if (spec.isGasGiant()) type =
"Gas giant";
2156 else if (spec.isNebulaCenter()) type =
"Nebula";
2157 else if (spec.isStar()) type =
"Star";
2158 if (mode == ListMode.RELATED_ENTRIES) {
2163 public boolean matchesTags(Set<String> tags) {
2164 if (tags.contains(ALL_TYPES))
return true;
2169 if (spec.isGasGiant() && !tags.contains(GAS_GIANTS)) {
2171 }
else if (spec.isStar() && !tags.contains(STARS)) {
2173 }
else if (!spec.isGasGiant() && !spec.isStar() && !tags.contains(PLANETS)) {
2180 public Set<String> getUnlockRelatedTags() {
2181 return spec.getTags();
2184 public boolean isUnlockedIfRequiresUnlock() {
2200 if (spec.getGenSpec() ==
null &&
2207 spec.getName(), spec.getIcon(), spec) {
2209 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
2211 if (mode == ListMode.RELATED_ENTRIES) {
2216 public boolean isVignetteIcon() {
2221 public boolean matchesTags(Set<String> tags) {
2223 if (tags.contains(OTHER) && !res)
return true;
2224 if (tags.contains(RESOURCES) && res)
return true;
2228 public Set<String> getUnlockRelatedTags() {
2229 return spec.getTags();
2232 public boolean isUnlockedIfRequiresUnlock() {
2258 List<CodexEntryPlugin> shipsAndStations =
new ArrayList<>();
2267 String baseId = getBaseHullIdEvenIfNotRestorableTo(spec);
2268 relatedHulls.
add(baseId, ship);
2274 for (List<CodexEntryPlugin> list : relatedHulls.values()) {
2284 if (sysId !=
null && !sysId.isBlank()) {
2285 String key = getShipSystemEntryId(sysId);
2289 ship.addRelatedEntry(sys);
2296 if (drone !=
null) {
2297 String droneHullId = getBaseHullId(drone.
getHullSpec());
2298 String droneEntryId = getShipEntryId(droneHullId);
2299 makeRelated(ship.getId(), droneEntryId);
2300 makeRelated(sys.
getId(), droneEntryId);
2309 String key = getShipSystemEntryId(sysId);
2313 ship.addRelatedEntry(sys);
2317 String variantId = spec.
getHullId() +
"_Hull";
2326 String key = getHullmodEntryId(
id);
2330 ship.addRelatedEntry(mod);
2348 String key = getWeaponEntryId(
id);
2350 if (weapon !=
null) {
2352 ship.addRelatedEntry(weapon);
2358 for (String
id : variant.
getWings()) {
2359 String key = getFighterEntryId(
id);
2361 if (fighter !=
null) {
2363 ship.addRelatedEntry(fighter);
2380 if (sysId !=
null) {
2381 String key = getShipSystemEntryId(sysId);
2385 fighter.addRelatedEntry(sys);
2391 String key = getShipSystemEntryId(sysId);
2395 fighter.addRelatedEntry(sys);
2401 String key = getHullmodEntryId(
id);
2405 fighter.addRelatedEntry(mod);
2412 String key = getWeaponEntryId(
id);
2414 if (weapon !=
null) {
2416 fighter.addRelatedEntry(weapon);
2422 List<CodexEntryPlugin> dem =
new ArrayList<>();
2438 String gasGiantListId =
"gas_giant_related_id";
2440 List<CodexEntryPlugin> habitablePlanets =
new ArrayList<>();
2449 relatedPlanets.
add(
id, planet);
2452 relatedPlanets.
add(
"nebula_related_id", planet);
2455 relatedPlanets.
add(gasGiantListId, planet);
2458 relatedPlanets.
add(
"pulsar_related_id", planet);
2461 relatedPlanets.
add(
"black_hole_related_id", planet);
2464 habitablePlanets.add(planet);
2468 for (List<CodexEntryPlugin> list : relatedPlanets.values()) {
2477 relatedDeposits.
add(commodityId, getEntry(getConditionEntryId(cid)));
2479 for (List<CodexEntryPlugin> list : relatedDeposits.values()) {
2509 makeRelated(habitable, planet);
2534 for (List<CodexEntryPlugin> list : commoditiesByDemandClass.values()) {
2541 List<CodexEntryPlugin> gasGiants = relatedPlanets.
getList(gasGiantListId);
2548 for (String conditionId : relatedConditions) {
2550 if (condition !=
null) {
2551 item.addRelatedEntry(condition);
2559 item.addRelatedEntry(gasGiant);
2560 gasGiant.addRelatedEntry(item);
2569 makeRelated(item.getId(), getShipEntryId(shipId));
2572 makeRelated(item.getId(), getFighterEntryId(fighterId));
2575 makeRelated(item.getId(), getWeaponEntryId(weaponId));
2591 for (String industryId : spec.
getParams().split(
",")) {
2592 makeRelated(curr.getId(), getIndustryEntryId(industryId.trim()));
2602 commodityToResourceConditions.
add(commodityId, condId);
2611 makeRelated(curr.getId(), getCommodityEntryId(comId));
2614 makeRelated(curr.getId(), getCommodityEntryId(comId));
2616 for (String condId : commodityToResourceConditions.
get(comId)) {
2617 makeRelated(curr.getId(), getConditionEntryId(condId));
2624 Set<String> seen =
new HashSet<>();
2625 while (otherId !=
null && !seen.contains(otherId)) {
2627 makeRelated(curr.getId(), getIndustryEntryId(otherId));
2632 while (otherId !=
null && !seen.contains(otherId)) {
2634 makeRelated(curr.getId(), getIndustryEntryId(otherId));
2651 for (String comId : commodityToResourceConditions.keySet()) {
2652 for (String condId : commodityToResourceConditions.
get(comId)) {
2653 makeRelated(getCommodityEntryId(comId), getConditionEntryId(condId));
2664 if (spec.
getAIHints().contains(AIHints.SYSTEM) &&
2669 String
id = weapon.getId();
2672 (spec.
getType() == WeaponType.BALLISTIC || spec.
getType() == WeaponType.ENERGY)) {
2677 if (spec.
getSize() == WeaponSize.SMALL) {
2700 String
id = skill.getId();
2705 makeRelated(
id, getHullmodEntryId(hullmodId));
2710 makeRelated(
id, getAbilityEntryId(abilityId));
2740 if (req.
getType() == CargoItemType.RESOURCES) {
2742 }
else if (req.
getType() == CargoItemType.SPECIAL) {
2781 makeRelated(getShipSystemEntryId(
"displacer"), getShipSystemEntryId(
"displacer_degraded"));
2784 makeRelated(getFighterEntryId(
"terminator_wing"), getShipSystemEntryId(
"drone_strike"));
2798 if (substrateEntry !=
null) {
2800 makeRelated(substrateEntry, dwellerPart);
2803 makeRelated(getWeaponEntryId(
"vortex_launcher"), getShipEntryId(
"shrouded_vortex"));
2842 if (one == two)
continue;
2843 one.addRelatedEntry(two);
2844 two.addRelatedEntry(one);
2851 if (one == two)
continue;
2852 one.addRelatedEntry(two);
2853 two.addRelatedEntry(one);
2858 for (String id1 : ids) {
2860 if (one ==
null)
continue;
2861 for (String id2 : ids) {
2862 if (id1 == id2)
continue;
2864 if (two ==
null)
continue;
2871 for (String id1 : ids) {
2873 if (one ==
null)
continue;
2874 for (String id2 : ids) {
2875 if (id1 == id2)
continue;
2877 if (two ==
null)
continue;
2907 return getShipEntryId(getFleetMemberBaseHullId(member));
2930 return "codex_hull_" + shipId;
2933 return "codex_weapon_" + weaponId;
2936 return "codex_fighter_" + wingId;
2939 return "codex_system_" + shipSystemId;
2942 return "codex_hullmod_" + hullModId;
2945 return "codex_planet_" + planetId;
2948 return "codex_condition_" + conditionId;
2951 return "codex_item_" + itemId;
2954 return "codex_industry_" + industryId;
2957 return "codex_commodity_" + commodityId;
2960 return "codex_faction_" + factionId;
2963 return "codex_mechanic_" + mechanicId;
2966 return "codex_gallery_" + galleryId;
2969 return "codex_skill_" + skillId;
2972 return "codex_ability_" + abilityId;
2980 return ENTRIES.get(
id);
2985 if (ROOT ==
null)
return;
2987 ENTRIES.put(ROOT.
getId(), ROOT);
2988 rebuildIdToEntryMap(ROOT);
2993 ENTRIES.put(child.getId(), child);
2994 if (!child.getChildren().isEmpty()) {
2995 rebuildIdToEntryMap(child);
3018 String entryId = UUID.randomUUID().toString();
3020 boolean station = spec.
getHints().contains(ShipTypeHints.STATION);
3026 boolean limited2 = limited;
3032 entryName = member.
getShipName() +
", " + entryName;
3034 if (limited) entryName = desc.
getText2();
3038 public void createTitleForList(
TooltipMakerAPI info,
float width, ListMode mode) {
3042 if (name ==
null || name.isBlank()) {
3052 }
else if (spec.
getHints().contains(ShipTypeHints.STATION)) {
3054 }
else if (spec.
getHints().contains(ShipTypeHints.MODULE)) {
3059 public boolean matchesTags(Set<String> tags) {
3063 public boolean isVisible() {
3068 public boolean isLocked() {
3073 linkFleetMemberEntryToRelated(entry, member,
true);
3076 if (station) parent = getEntry(CAT_STATIONS);
3079 List<CodexEntryPlugin> result =
new ArrayList<>();
3082 List<CodexEntryPlugin> modules = addModulesForVariant(member.
getVariant(),
false, entry, parent);
3083 result.addAll(modules);
3104 if (hullEntry !=
null) {
3106 if (rel.hasTag(TAG_EMPTY_MODULE))
continue;
3122 rel.addRelatedEntry(entry);
3127 if (sysId !=
null && !sysId.isBlank()) {
3128 String key = getShipSystemEntryId(sysId);
3139 if (drone !=
null) {
3140 String droneHullId = getBaseHullId(drone.
getHullSpec());
3141 String droneEntryId = getShipEntryId(droneHullId);
3142 makeRelated(entry.
getId(), droneEntryId);
3143 makeRelated(sys.
getId(), droneEntryId);
3154 if (other !=
null) {
3161 if (other !=
null) {
3168 if (other !=
null) {
3176 if (sl.getLevel() > 0 && sl.getSkill().isCombatOfficerSkill()) {
3178 if (other !=
null) {
3189 return entry !=
null && !entry.
isLocked();
3194 return entry !=
null && !entry.
isLocked();
3198 if (entry ==
null)
return;
3200 rel.removeRelatedEntry(entry.
getId());
3203 ENTRIES.remove(entry.
getId());
3205 Set<String>
remove =
new LinkedHashSet<>();
3206 for (String
id : SEEN_STATION_MODULES.keySet()) {
3207 if (SEEN_STATION_MODULES.get(
id) == entry) {
3211 for (String
id :
remove) {
3212 SEEN_STATION_MODULES.remove(
id);
static SettingsAPI getSettings()
List< String > getProvidedFighters()
List< String > getProvidedShips()
List< String > getProvidedWeapons()
boolean isPlayerAwareOfShipSystem(String sysId)
boolean isPlayerAwareOfPlanet(String planetId)
boolean isPlayerAwareOfSkill(String skillId)
boolean isPlayerAwareOfCommodity(String commodityId)
boolean isPlayerAwareOfShip(String hullId)
boolean isPlayerAwareOfIndustry(String industryId)
boolean isPlayerAwareOfIllustration(String key)
boolean isPlayerAwareOfHullmod(String hullmodId)
static SharedUnlockData get()
boolean isPlayerAwareOfAbility(String abilityId)
boolean isPlayerAwareOfWeapon(String weaponId)
boolean isPlayerAwareOfCondition(String conditionId)
boolean isPlayerAwareOfSpecialItem(String itemId)
boolean isPlayerAwareOfFighter(String fighterId)
static Map< String, String > COMMODITY
static Map< String, InstallableItemEffect > ITEM_EFFECTS
static String NOT_A_GAS_GIANT
static final String SENSOR_BURST
static final String SUSTAINED_BURN
static final String GO_DARK
static final String INTERDICTION_PULSE
static final String EMERGENCY_BURN
static final String TRANSVERSE_JUMP
static final String MARINES
static final String ALPHA_CORE
static final String BETA_CORE
static final String LOBSTER
static final String TAG_NON_ECONOMIC
static final String GAMMA_CORE
static final String TAG_AI_CORE
static final String DENSE_ATMOSPHERE
static final String TOXIC_ATMOSPHERE
static final String RUINS_WIDESPREAD
static final String NO_ATMOSPHERE
static final String HIGH_GRAVITY
static final String RUINS_SCATTERED
static final String RUINS_EXTENSIVE
static final String VOLTURNIAN_LOBSTER_PENS
static final String POOR_LIGHT
static final String VERY_COLD
static final String RUINS_VAST
static final String EXTREME_TECTONIC_ACTIVITY
static final String THIN_ATMOSPHERE
static final String DECIVILIZED
static final String VERY_HOT
static final String TECTONIC_ACTIVITY
static final String LOW_GRAVITY
static final String WATER_SURFACE
static final String MILD_CLIMATE
static final String DECIVILIZED_SUBPOP
static final String HABITABLE
static final String NEURAL_INTEGRATOR
static final String ADVANCED_GROUND_SUPPORT
static final String BALLISTIC_RANGEFINDER
static final String AUTOMATED
static final String MAGAZINES
static final String MISSILE_AUTOLOADER
static final String VAST_HANGAR
static final String GROUND_SUPPORT
static final String PHASE_FIELD
static final String VASTBULK
static final String ADVANCED_TARGETING_CORE
static final String CONVERTED_HANGAR
static final String DESIGN_COMPROMISES
static final String TAG_PARENT
static final String TAG_STRUCTURE
static final String TAG_STATION
static final String FARMING
static final String TECHMINING
static final String TAG_INDUSTRY
static final String AQUACULTURE
static final String TAG_SINGLE_BP
static final String INDUSTRY_BP
static final String TAG_COLONY_ITEM
static final String TAG_BLUEPRINT_PACKAGE
static final String SHROUDED_SUBSTRATE
static final String TAG_MODSPEC
static final String PLANET_LAVA_MINOR
static final String PLANET_WATER
static final String PLANET_LAVA
static String ENERGY_LASH
static final String AUTOMATED_SHIPS
static final String TAG_DEPRECATED
static final String HULL_RESTORATION
static final String DERELICT_CONTINGENT
static final String TAG_NPC_ONLY
static final String CONTAINMENT_PROCEDURES
static final String NAVIGATION
static final String NEURAL_LINK
static final String TAG_AI_CORE_ONLY
static final String SENSORS
static final String TACTICAL_DRILLS
static final String PHASE_CORPS
static String getFleetMemberEntryId(FleetMemberAPI member)
static String getIndustryEntryId(String industryId)
static void makeUnrelated(String ... ids)
static void sortSkillsCategory()
static String getFleetMemberBaseHullId(FleetMemberAPI member)
static String getGalleryEntryId(String galleryId)
static String getAptitudeName(SkillSpecAPI spec)
static Map< String, Float > CAT_SORT_RELATED_ENTRIES
static String CAT_STATIONS
static void populateGallery(CodexEntryPlugin parent)
static void linkFleetMemberEntryToRelated(CodexEntryPlugin entry, FleetMemberAPI member, boolean linkCaptainSkills)
static boolean codexFullyUnlocked()
static boolean WITH_GAME_MECHANICS_CAT
static boolean WITH_CUSTOM_EXAMPLE_CAT
static String CAT_STARS_AND_PLANETS
static String getFighterEntryId(String wingId)
static String getIcon(String key)
static String CAT_HULLMODS
static void populateSkills(CodexEntryPlugin parent)
static String ALL_APTITUDES
static String UNKNOWN_ENTRY_ID
static CodexEntryV2 createHullModsCategory()
static CodexEntryV2 createStationsCategory()
static void addUnknownEntry()
static String getCommodityEntryId(String commodityId)
static void populateAbilities(CodexEntryPlugin parent)
static String getShipSystemEntryId(String shipSystemId)
static void makeRelated(CodexEntryPlugin ... plugins)
static String ALL_DAMAGE_TYPES
static CodexEntryPlugin ROOT
static String CAT_COMMODITIES
static void populateIndustries(CodexEntryPlugin parent)
static String HIGH_EXPLOSIVE
static String CAT_SPECIAL_ITEMS
static CodexEntryV2 createGalleryCategory()
static void makeRelated(String ... ids)
static String CAT_CUSTOM_EXAMPLE
static String INTERCEPTOR
static List< CodexEntryPlugin > createTempFleetMemberEntry(FleetMemberAPI member)
static CodexEntryV2 createFightersCategory()
static String getPlanetEntryId(String planetId)
static String CAT_ABILITIES
static void populateWeapons(CodexEntryPlugin parent)
static String PILOTED_SHIP
static String TAG_EMPTY_MODULE
static String COMBAT_SHIPS
static String getHullmodEntryId(String hullModId)
static void populateFighters(CodexEntryPlugin parent)
static CodexEntryV2 createSpecialItemsCategory()
static void makeRelated(List< CodexEntryPlugin > plugins)
static CodexEntryV2 createCustomExampleCategory()
static void populateHullMods(CodexEntryPlugin parent)
static void populateStarsAndPlanets(CodexEntryPlugin parent)
static String getWeaponEntryId(String weaponId)
static void populateShipSystems(CodexEntryPlugin parent, CodexEntryPlugin ships)
static String CAT_GAME_MECHANICS
static CodexEntryPlugin addModuleEntry(CodexEntryPlugin parent, CodexEntryPlugin entryForParentShip, FleetMemberAPI member, boolean isEmptyHull)
static void rebuildIdToEntryMap()
static CodexEntryV2 createGameMechanicsCategory()
static void linkRelatedEntries()
static CodexEntryV2 createStarsAndPlanetsCategory()
static String FIGHTER_WEAPON
static Map< String, CodexEntryPlugin > ENTRIES
static CodexEntryV2 createShipSystemsCategory()
static String getBaseHullIdEvenIfNotRestorableTo(ShipHullSpecAPI spec)
static String getFactionEntryId(String factionId)
static CodexEntryV2 createShipsCategory()
static void rebuildIdToEntryMap(CodexEntryPlugin curr)
static void populateShipsAndStations(CodexEntryPlugin ships, CodexEntryPlugin stations)
static Map< String, CodexEntryPlugin > SEEN_STATION_MODULES
static void populateCommodities(CodexEntryPlugin commodities, CodexEntryPlugin items)
static String getConditionEntryId(String conditionId)
static String PHASE_SHIPS
static void populateSpecialItems(CodexEntryPlugin parent)
static CodexEntryV2 createAbilitiesCategory()
static String getAbilityEntryId(String abilityId)
static boolean USE_KEY_NAMES_FOR_GALLERY
static void unlinkAndRemoveTempEntry(CodexEntryPlugin entry)
static String getShipEntryId(String shipId)
static String FRAGMENTATION
static List< CodexEntryPlugin > addModulesForVariant(ShipVariantAPI variant, boolean isEmptyHull, CodexEntryPlugin entry, CodexEntryPlugin parent)
static CodexEntryV2 createIndustriesCategory()
static void populatePlanetaryConditions(CodexEntryPlugin parent)
static CodexEntryV2 createWeaponsCategory()
static void addCustomCodexEntryDetailPanelExample()
static String getBaseHullId(ShipHullSpecAPI spec)
static void setCatSort(CodexEntryPlugin root, Set< CodexEntryPlugin > seen)
static boolean hasUnlockedEntryForShip(String hullId)
static String getItemEntryId(String itemId)
static String CAT_WEAPONS
static boolean hasUnlockedEntry(String entryId)
static CodexEntryV2 createPlanetaryConditionsCategory()
static CodexEntryV2 createCommoditiesCategory()
static String CAT_FIGHTERS
static String CAT_GALLERY
static String getSkillEntryId(String skillId)
static String CAT_SHIP_SYSTEMS
static CodexEntryPlugin getEntry(String id)
static String CAT_PLANETARY_CONDITIONS
static CodexEntryV2 createSkillsCategory()
static String getMechanicEntryId(String mechanicId)
static String CAT_INDUSTRIES
void setParent(CodexEntryPlugin parent)
void setRetainOrderOfChildren(boolean retainOrderOfChildren)
void setParam(Object param)
void setParam2(Object param2)
void addRelatedEntry(CodexEntryPlugin entry)
Set< String > getRelatedEntryIds()
Set< CodexEntryPlugin > getRelatedEntries()
static void linkRelated()
static void loadTextEntries()
ModSpecAPI getSourceMod()
void setText1(String text1)
void setText2(String text2)
void add(K key, int quantity)
List< V > getList(String key)
List< V > get(Object key)
void add(String key, V value)
static String ucFirst(String str)
static Color getBasePlayerColor()
static Color getGrayColor()
static Color getHighlightColor()
static boolean canPlanetTypeRollHabitable(PlanetSpecAPI spec)
static Color getDarkPlayerColor()
List< ModPlugin > getEnabledModPlugins()
AbilitySpecAPI getAbilitySpec(String abilityId)
ModManagerAPI getModManager()
Description getDescription(String id, Type type)
String getSpriteName(String category, String id)
List< WeaponSpecAPI > getActuallyAllWeaponSpecs()
List< ShipSystemSpecAPI > getAllShipSystemSpecs()
ShipVariantAPI getVariant(String variantId)
List< IndustrySpecAPI > getAllIndustrySpecs()
SkillSpecAPI getSkillSpec(String skillId)
ShipHullSpecAPI getHullSpec(String hullId)
Set< String > getIndustryDemand(String industryId)
IndustrySpecAPI getIndustrySpec(String industryId)
List< HullModSpecAPI > getAllHullModSpecs()
boolean getBoolean(String key)
List< String > getSpriteKeys(String category)
List< String > getSortedAbilityIds()
FleetMemberAPI createFleetMember(FleetMemberType type, String variantOrWingId)
List< SpecialItemSpecAPI > getAllSpecialItemSpecs()
List< PlanetSpecAPI > getAllPlanetSpecs()
List< CommoditySpecAPI > getAllCommoditySpecs()
List< ShipHullSpecAPI > getAllShipHullSpecs()
Set< String > getIndustrySupply(String industryId)
List< String > getSkillIds()
List< MarketConditionSpecAPI > getAllMarketConditionSpecs()
List< FighterWingSpecAPI > getAllFighterWingSpecs()
SpecialItemSpecAPI getSpecialItemSpecIfSpecial()
CargoAPI.CargoItemType getType()
String getDescriptionId()
void init(CargoStackAPI stack)
boolean hasTag(String tag)
SpecialItemPlugin getNewPluginInstance(CargoStackAPI stack)
boolean hasTag(String tag)
List< SkillLevelAPI > getSkillsCopy()
MutableCharacterStatsAPI getStats()
String getGoverningAptitudeName()
boolean hasTag(String tag)
boolean isAptitudeEffect()
Set< String > getAllAbilityUnlocks()
Set< String > getAllHullmodUnlocks()
default CargoStackAPI getRequiredItem()
String getRestoredToHullId()
boolean hasTag(String tag)
EnumSet< ShipTypeHints > getHints()
String getShipDefenseId()
boolean isRestoreToBase()
WeaponSlotAPI getWeaponSlot(String slotId)
ShipHullSpecAPI getDParentHull()
ShipHullSpecAPI getBaseHull()
String getCodexVariantId()
boolean isCivilianNonCarrier()
String getDescriptionId()
ShipSystemStatsScript getStatsScript()
Collection< String > getHullMods()
boolean hasTag(String tag)
String getWeaponId(String slotId)
String getFullDesignationForShip()
List< String > getFittedWings()
Map< String, String > getStationModules()
List< String > getWings()
ShipVariantAPI getModuleVariant(String slotId)
Collection< String > getFittedWeaponSlots()
JSONObject toJSONObject()
boolean hasHullMod(String id)
ShipHullSpecAPI getHullSpec()
String getFullDesignationWithHullNameForShip()
ShipVariantAPI getVariant()
ShipHullSpecAPI getHullSpec()
List< String > getRequirements(Industry industry)
Set< String > getConditionsRelatedToRequirements(Industry industry)
void addRelatedEntry(CodexEntryPlugin entry)
void addChild(CodexEntryPlugin entry)
void removeRelatedEntry(CodexEntryPlugin entry)
void setRetainOrderOfChildren(boolean retainOrderOfChildren)
Set< CodexEntryPlugin > getRelatedEntries()
CodexEntryPlugin getParent()
List< CodexEntryPlugin > getChildren()
boolean hasTag(String tag)
ShipVariantAPI getVariant()
boolean hasTag(String tag)
Set< String > getUITags()
HullModEffect getEffect()
boolean hasTag(String tag)
boolean hasTag(String tag)
String getPrimaryRoleStr()
EnumSet< WeaponAPI.AIHints > getAIHints()
WeaponType getMountType()
DamageType getDamageType()
TooltipMakerAPI createUIElement(float width, float height, boolean withScroller)
void updateUIElementSizeAndMakeItProcessInput(TooltipMakerAPI element)
UIPanelAPI wrapTooltipWithBox(TooltipMakerAPI tooltip)
PositionAPI inTL(float xPad, float yPad)
PositionAPI setSize(float width, float height)
PositionAPI inTR(float xPad, float yPad)
void setTotalOverrideForCurrentGroup(int totalOverrideForCurrentGroup)
void beginGroup(boolean mutuallyExclusive, String allText)
void setGroupChecked(int index, boolean checked)
PositionAPI getPosition()
PositionAPI addComponent(UIComponentAPI custom)