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