Starsector API
Loading...
Searching...
No Matches
BreadcrumbIntel.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.intel.misc;
2
3import java.util.ArrayList;
4import java.util.List;
5import java.util.Set;
6
7import java.awt.Color;
8
9import com.fs.starfarer.api.Global;
10import com.fs.starfarer.api.campaign.FactionAPI;
11import com.fs.starfarer.api.campaign.SectorEntityToken;
12import com.fs.starfarer.api.impl.campaign.ids.Tags;
13import com.fs.starfarer.api.ui.SectorMapAPI;
14import com.fs.starfarer.api.ui.TooltipMakerAPI;
15import com.fs.starfarer.api.util.Misc;
16
17public class BreadcrumbIntel extends FleetLogIntel {
18
21
22 protected String title;
23 protected String text;
24
25 protected Boolean showSpecificEntity = null;
26
28 if (foundAt != null) {
29 this.foundAt = makeDoubleWithSameOrbit(foundAt);
30 }
31 this.target = makeDoubleWithSameOrbit(target);
34
35
36// String targetName = BreadcrumbSpecial.getNameWithAOrAn(target, null, true);
37// String targetNameUC = BreadcrumbSpecial.getNameWithAOrAn(target, null, false);
38// //String entityName = getNameWithAOrAn(entity, null);
39// String located = BreadcrumbSpecial.getLocatedString(target);
40//
41// String subject = "Location: " + Misc.ucFirst(targetNameUC.substring(targetNameUC.indexOf(" ") + 1)) + "");
42// String text1ForIntel = Misc.getStringWithTokenReplacement("While exploring $aOrAn $nameInText, " +
43// "your crews found a partially accessible memory bank " +
44// "containing information that indicates " + targetName + " is " + located + ".",
45// foundAt, null);
46 }
47
48 @Override
49 public void reportRemovedIntel() {
50 super.reportRemovedIntel();
52 }
53
54
55
57 SectorEntityToken copy = entity.getContainingLocation().createToken(entity.getLocation().x, entity.getLocation().y);
58 if (entity.getOrbit() != null) {
59 copy.setOrbit(entity.getOrbit().makeCopy());
60 }
61 return copy;
62 }
63
64
65 public String getTitle() {
66 return title;
67 }
68
69 public void setTitle(String title) {
70 this.title = title;
71 }
72
73 public String getText() {
74 return text;
75 }
76
77 public void setText(String text) {
78 this.text = text;
79 }
80
81 @Override
82 public void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode) {
83 Color c = getTitleColor(mode);
84 info.addPara(getName(), c, 0f);
85 }
86
87 @Override
88 public void createSmallDescription(TooltipMakerAPI info, float width, float height) {
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 info.addImage(Global.getSettings().getSpriteName("illustrations", "space_wreckage"), width, opad);
96
97 info.addPara(text, opad);
98
99 //target.getOrbit().updateLocation();
100
101// float days = getDaysSincePlayerVisible();
102// if (days >= 1) {
103// addDays(info, "ago.", days, tc, opad);
104// }
105 addLogTimestamp(info, tc, opad);
106
107// LuddicPathBaseIntel base = new LuddicPathBaseIntel((StarSystemAPI) Global.getSector().getCurrentLocation(), Factions.LUDDIC_PATH);
108// Global.getSector().addScript(base);
109// MemoryAPI mem = base.getEntity().getMemoryWithoutUpdate();
110// mem.set("$blah", t
111
112 addDeleteButton(info, width);
113 }
114
115 @Override
116 public String getIcon() {
117 return super.getIcon();
118 }
119
120 @Override
121 public Set<String> getIntelTags(SectorMapAPI map) {
122 Set<String> tags = super.getIntelTags(map);
123 tags.remove(Tags.INTEL_FLEET_LOG);
124 tags.add(Tags.INTEL_EXPLORATION);
125 return tags;
126 }
127
128 public String getSortString() {
129 //return "Location";
130 return super.getSortString();
131 }
132
133 public String getName() {
134 return title;
135 }
136
137 @Override
139 return super.getFactionForUIColors();
140 }
141
142 public String getSmallDescriptionTitle() {
143 return getName();
144 }
145
146 @Override
148 if (target.getStarSystem() != null && showSpecificEntity == null) {
149 return target.getStarSystem().createToken(0, 0);
150 //return target.getStarSystem().getCenter();
151 }
152 return target;
153 }
154
155 @Override
156 public boolean shouldRemoveIntel() {
157 return super.shouldRemoveIntel();
158 }
159
160 @Override
161 public String getCommMessageSound() {
162 if (sound != null) return sound;
163 return getSoundMinorMessage();
164 }
165
166 public Boolean getShowSpecificEntity() {
167 return showSpecificEntity;
168 }
169
170 public void setShowSpecificEntity(Boolean showPlanet) {
171 if (showPlanet != null && !showPlanet) showPlanet = null;
172
173 this.showSpecificEntity = showPlanet;
174 }
175
176 public List<ArrowData> getArrowData(SectorMapAPI map) {
177 if (true) return null;
178
179 if (foundAt == null) return null;
180
181 List<ArrowData> result = new ArrayList<ArrowData>();
182
184 foundAt.getContainingLocation() != null &&
186 return null;
187 }
188
189// SectorEntityToken entityFrom = foundLocation;
190// if (map != null) {
191// SectorEntityToken iconEntity = map.getIntelIconEntity(this);
192// if (iconEntity != null) {
193// entityFrom = iconEntity;
194// }
195// }
196//
197// ArrowData arrow = new ArrowData(entityFrom, targetLocation);
198 ArrowData arrow = new ArrowData(foundAt, target);
199
200 arrow.color = getFactionForUIColors().getBaseUIColor();
201 result.add(arrow);
202
203 return result;
204 }
205
206
207
208
209}
static SettingsAPI getSettings()
Definition Global.java:57
void addLogTimestamp(TooltipMakerAPI info, Color tc, float opad)
void addDeleteButton(TooltipMakerAPI info, float width)
void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode)
static SectorEntityToken makeDoubleWithSameOrbit(SectorEntityToken entity)
BreadcrumbIntel(SectorEntityToken foundAt, SectorEntityToken target)
void createSmallDescription(TooltipMakerAPI info, float width, float height)
static Color getTextColor()
Definition Misc.java:839
static Color getGrayColor()
Definition Misc.java:826
static Color getHighlightColor()
Definition Misc.java:792
String getSpriteName(String category, String id)
void addEntity(SectorEntityToken entity)
SectorEntityToken createToken(float x, float y)
void removeEntity(SectorEntityToken entity)
void addImage(String spriteName, float pad)
LabelAPI addPara(String format, float pad, Color hl, String... highlights)