Starsector API
Loading...
Searching...
No Matches
PLIntel.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.plog;
2
3import java.awt.Color;
4import java.util.Set;
5
6import com.fs.starfarer.api.Global;
7import com.fs.starfarer.api.campaign.FactionAPI;
8import com.fs.starfarer.api.campaign.SectorEntityToken;
9import com.fs.starfarer.api.impl.campaign.ids.Tags;
10import com.fs.starfarer.api.impl.campaign.intel.BaseIntelPlugin;
11import com.fs.starfarer.api.ui.CustomPanelAPI;
12import com.fs.starfarer.api.ui.SectorMapAPI;
13import com.fs.starfarer.api.ui.TooltipMakerAPI;
14import com.fs.starfarer.api.util.Misc;
15
16public class PLIntel extends BaseIntelPlugin {
17 //public static Logger log = Global.getLogger(PLIntel.class);
18
19 public PLIntel() {
20 //Global.getSector().getIntelManager().addIntel(this);
21 }
22
23 protected void addBulletPoints(TooltipMakerAPI info, ListInfoMode mode) {
24
25 Color h = Misc.getHighlightColor();
26 Color g = Misc.getGrayColor();
27 float pad = 3f;
28 float opad = 10f;
29
30 float initPad = pad;
31 if (mode == ListInfoMode.IN_DESC) initPad = opad;
32
33 Color tc = getBulletColorForMode(mode);
34
35 bullet(info);
36 //boolean isUpdate = getListInfoParam() != null;
37
38// info.addPara("Factions: ", tc, initPad);
39// indent(info);
40// LabelAPI label = info.addPara("%s and %s", 0f, tc,
41// h, one.getDisplayName(), two.getDisplayName());
42// label.setHighlight(one.getDisplayName(), two.getDisplayName());
43// label.setHighlightColors(one.getBaseUIColor(), two.getBaseUIColor());
44//
45// info.addPara(one.getDisplayName(), 0f, tc,
46// one.getBaseUIColor(), one.getDisplayName());
47// info.addPara(two.getDisplayName(), 0f, tc,
48// two.getBaseUIColor(), two.getDisplayName());
49
50 unindent(info);
51 }
52
53 @Override
54 public void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode) {
55 Color h = Misc.getHighlightColor();
56 Color g = Misc.getGrayColor();
57 Color c = getTitleColor(mode);
58 float pad = 3f;
59 float opad = 10f;
60
61 info.addPara(getName(), c, 0f);
62
63 addBulletPoints(info, mode);
64 }
65
66 public String getSortString() {
67 return "History";
68 }
69
70 public String getName() {
71 if (Misc.isPlayerFactionSetUp()) {
72 return Global.getSector().getPlayerFaction().getDisplayName() + " - History";
73 }
74 return Global.getSector().getPlayerPerson().getNameString() + " - History";
75 //return "Fleet Log";
76 }
77
78 @Override
79 public FactionAPI getFactionForUIColors() {
80 return Global.getSector().getPlayerFaction();
81 }
82
83 public String getSmallDescriptionTitle() {
84 return getName();
85 }
86
87 public void createLargeDescription(CustomPanelAPI panel, float width, float height) {
88
89 Color h = Misc.getHighlightColor();
90 Color g = Misc.getGrayColor();
91 Color tc = Misc.getTextColor();
92 float pad = 3f;
93 float opad = 10f;
94
95 TooltipMakerAPI info = panel.createUIElement(width, height, false);
96 panel.addUIElement(info).inTL(0, 0);
97
98 // sorry
99 info.addPlaythroughDataPanel(width, height);
100 }
101
102 @Override
103 public boolean hasLargeDescription() {
104 return true;
105 }
106
107 @Override
108 public boolean hasSmallDescription() {
109 return false;
110 }
111
112 public String getIcon() {
113 return Global.getSettings().getSpriteName("intel", "fleet_log");
114 }
115
116 public Set<String> getIntelTags(SectorMapAPI map) {
117 Set<String> tags = super.getIntelTags(map);
118 tags.add(Tags.INTEL_FLEET_LOG);
119 tags.add(Tags.INTEL_STORY);
120 return tags;
121 }
122
123 @Override
124 public SectorEntityToken getMapLocation(SectorMapAPI map) {
125 return null;
126 }
127
128}
129
130
131
static SettingsAPI getSettings()
Definition Global.java:51
static SectorAPI getSector()
Definition Global.java:59
void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode)
Definition PLIntel.java:54
Set< String > getIntelTags(SectorMapAPI map)
Definition PLIntel.java:116
void addBulletPoints(TooltipMakerAPI info, ListInfoMode mode)
Definition PLIntel.java:23
void createLargeDescription(CustomPanelAPI panel, float width, float height)
Definition PLIntel.java:87
SectorEntityToken getMapLocation(SectorMapAPI map)
Definition PLIntel.java:124
String getSpriteName(String category, String id)