Starsector API
Loading...
Searching...
No Matches
DistressCallIntel.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.intel.misc;
2
3import java.awt.Color;
4
5import com.fs.starfarer.api.Global;
6import com.fs.starfarer.api.campaign.StarSystemAPI;
7import com.fs.starfarer.api.ui.TooltipMakerAPI;
8import com.fs.starfarer.api.util.Misc;
9
11
13
15 super(system.getCenter());
16 this.system = system;
18
19 //setIcon(Global.getSettings().getSpriteName("intel", "distress_call"));
20 setIconId("distress_call");
21 setSound("ui_intel_distress_call");
22 setDuration(60f);
23 setTitle("Distress Call");
24 setText("You receive a distress call from the nearby " + system.getNameWithLowercaseType() + ". " +
25 "There's no additional information, but that's not surprising - " +
26 "a typical fleet doesn't carry the equipment to broadcast a full-fledged data " +
27 "stream into hyperspace.");
28 }
29
30 @Override
31 public void advance(float amount) {
32 super.advance(amount);
35 }
36 }
37
38
39
40 public void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode) {
41 Color c = getTitleColor(mode);
42 info.addPara(getName(), c, 0f);
43
44 float pad = 3f;
45 float opad = 10f;
46
47 float initPad = pad;
48 if (mode == ListInfoMode.IN_DESC) initPad = opad;
49
50 Color tc = getBulletColorForMode(mode);
51 if (system != null) {
52 bullet(info);
53 info.addPara("Originating in the " + system.getNameWithLowercaseType() + "", tc, initPad);
54 unindent(info);
55 }
56 }
57
58 @Override
59 public void createSmallDescription(TooltipMakerAPI info, float width, float height) {
60 Color h = Misc.getHighlightColor();
61 Color g = Misc.getGrayColor();
62 Color tc = Misc.getTextColor();
63 float pad = 3f;
64 float opad = 10f;
65
66 info.addPara(text, opad);
67
68// float days = getDaysSincePlayerVisible();
69// if (days >= 1) {
70// addDays(info, "ago.", days, tc, opad);
71// }
72
73 if (isEnding()) {
74 info.addPara("You've investigated the system this distress call came from.", opad);
75 }
76
77 addLogTimestamp(info, tc, opad);
78
79 addDeleteButton(info, width);
80 }
81
82 public String getSortString() {
83 //return "Distress Call";
84 return super.getSortString();
85 }
86
87 public String getName() {
88 if (isEnding()) return title + " - Investigated";
89 return title;
90 }
91
92 @Override
93 public boolean shouldRemoveIntel() {
94 if (isEnded()) return true;
95 return super.shouldRemoveIntel();
96 }
97
98
99}
static SectorAPI getSector()
Definition Global.java:65
void addLogTimestamp(TooltipMakerAPI info, Color tc, float opad)
void addDeleteButton(TooltipMakerAPI info, float width)
void createSmallDescription(TooltipMakerAPI info, float width, float height)
void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode)
static Color getTextColor()
Definition Misc.java:839
static Color getGrayColor()
Definition Misc.java:826
static Color getHighlightColor()
Definition Misc.java:792
void addScript(EveryFrameScript script)
LabelAPI addPara(String format, float pad, Color hl, String... highlights)