Starsector API
Loading...
Searching...
No Matches
IntelMarkerIntel.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.missions.hub;
2
3import java.awt.Color;
4import java.util.ArrayList;
5import java.util.LinkedHashSet;
6import java.util.List;
7import java.util.Set;
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.impl.campaign.intel.BaseIntelPlugin;
14import com.fs.starfarer.api.ui.SectorMapAPI;
15import com.fs.starfarer.api.ui.TooltipMakerAPI;
16import com.fs.starfarer.api.util.Misc;
17
18public class IntelMarkerIntel extends BaseIntelPlugin {
19
20 protected SectorEntityToken loc;
21 protected String title;
22 protected String icon;
23 protected String text;
24 protected LinkedHashSet<String> tags = new LinkedHashSet<String>();
25 protected FactionAPI faction;
26
27 public IntelMarkerIntel(FactionAPI faction, SectorEntityToken loc,
28 String icon, String title, String text,
29 Set<String> tags) {
30 this.faction = faction;
31 this.loc = loc;
32 this.icon = icon;
33 this.title = title;
34 this.text = text;
35 this.tags.addAll(tags);
36 }
37
38// @Override
39// public void advance(float amount) {
40// super.advance(amount);
41// if (!isEnded() && !Global.getSector().isPaused()) {
42// endImmediately();
43// }
44// }
45
46 @Override
47 public void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode) {
48 Color h = Misc.getHighlightColor();
49 Color g = Misc.getGrayColor();
50 Color c = getTitleColor(mode);
51 float pad = 3f;
52 float opad = 10f;
53
54 c = Misc.getHighlightColor();
55
56 info.addPara(title, c, 0f);
57
58// if (subtitle != null) {
59// float initPad = pad;
60// bullet(info);
61// //info.addPara(subtitle, c, initPad);
62// info.addPara(subtitle, g, initPad);
63// unindent(info);
64// }
65 }
66
67 public String getSortString() {
68 return title;
69 }
70
71 @Override
72 public IntelSortTier getSortTier() {
73 return IntelSortTier.TIER_0;
74 }
75
76 public String getName() {
77 return title;
78 }
79
80 public String getSmallDescriptionTitle() {
81 return getName();
82 }
83
84 public void createSmallDescription(TooltipMakerAPI info, float width, float height) {
85
86 Color h = Misc.getHighlightColor();
87 Color g = Misc.getGrayColor();
88 Color tc = Misc.getTextColor();
89 float pad = 3f;
90 float opad = 10f;
91
92// if (image != null) {
93// info.addImage(image, width, 128, opad);
94// }
95 if (text != null && !text.isEmpty()) {
96 info.addPara(text, tc, opad);
97 }
98 }
99
100 @Override
101 public FactionAPI getFactionForUIColors() {
102 //return faction;
103 return super.getFactionForUIColors();
104 }
105
106 public String getIcon() {
107 return icon;
108 }
109
110 public Set<String> getIntelTags(SectorMapAPI map) {
111 //Set<String> tags = super.getIntelTags(map);
112 Set<String> tags = new LinkedHashSet<String>(this.tags);
113 //tags.add(Tags.INTEL_MISSIONS);
114 tags.add(Tags.INTEL_NEW);
115 return tags;
116 }
117
118 @Override
119 public SectorEntityToken getMapLocation(SectorMapAPI map) {
120 return loc;
121 }
122
123 @Override
124 public List<ArrowData> getArrowData(SectorMapAPI map) {
125 //return super.getArrowData(map);
126 List<ArrowData> result = new ArrayList<ArrowData>();
127 ArrowData d = new ArrowData(Global.getSector().getPlayerFleet(), loc);
128 result.add(d);
129 return result;
130 }
131
133 return Misc.getHighlightColor();
134 }
135
136}
137
138
static SectorAPI getSector()
Definition Global.java:59
void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode)
IntelMarkerIntel(FactionAPI faction, SectorEntityToken loc, String icon, String title, String text, Set< String > tags)
void createSmallDescription(TooltipMakerAPI info, float width, float height)