Starsector API
Loading...
Searching...
No Matches
JumpPointInteractionDialogPluginImpl.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign;
2
3import java.util.ArrayList;
4import java.util.Arrays;
5import java.util.HashMap;
6import java.util.List;
7import java.util.Map;
8
9import java.awt.Color;
10
11import org.lwjgl.input.Keyboard;
12
13import com.fs.starfarer.api.Global;
14import com.fs.starfarer.api.campaign.CampaignFleetAPI;
15import com.fs.starfarer.api.campaign.FactionAPI;
16import com.fs.starfarer.api.campaign.InteractionDialogAPI;
17import com.fs.starfarer.api.campaign.InteractionDialogPlugin;
18import com.fs.starfarer.api.campaign.JumpPointAPI;
19import com.fs.starfarer.api.campaign.JumpPointAPI.JumpDestination;
20import com.fs.starfarer.api.campaign.OptionPanelAPI;
21import com.fs.starfarer.api.campaign.SectorEntityToken;
22import com.fs.starfarer.api.campaign.TextPanelAPI;
23import com.fs.starfarer.api.campaign.VisualPanelAPI;
24import com.fs.starfarer.api.campaign.econ.MarketAPI;
25import com.fs.starfarer.api.campaign.impl.items.WormholeScannerPlugin;
26import com.fs.starfarer.api.campaign.rules.MemKeys;
27import com.fs.starfarer.api.campaign.rules.MemoryAPI;
28import com.fs.starfarer.api.characters.AbilityPlugin;
29import com.fs.starfarer.api.combat.EngagementResultAPI;
30import com.fs.starfarer.api.impl.campaign.abilities.TransponderAbility;
31import com.fs.starfarer.api.impl.campaign.ids.Abilities;
32import com.fs.starfarer.api.impl.campaign.ids.Factions;
33import com.fs.starfarer.api.impl.campaign.ids.MemFlags;
34import com.fs.starfarer.api.impl.campaign.rulecmd.DumpMemory;
35import com.fs.starfarer.api.impl.campaign.rulecmd.salvage.MiscCMD;
36import com.fs.starfarer.api.impl.campaign.shared.WormholeManager;
37import com.fs.starfarer.api.impl.campaign.tutorial.TutorialMissionIntel;
38import com.fs.starfarer.api.loading.Description;
39import com.fs.starfarer.api.loading.Description.Type;
40import com.fs.starfarer.api.ui.LabelAPI;
41import com.fs.starfarer.api.util.Misc;
42
44
45 public static final String UNSTABLE_KEY = "$unstable";
46 public static final String CAN_STABILIZE = "$canStabilize";
47
48 public static float WORMHOLE_FUEL_USE_MULT = 5f;
49
50 private static enum OptionId {
51 INIT,
52 JUMP_1,
53 JUMP_2,
54 JUMP_3,
55 JUMP_4,
56 JUMP_5,
57 JUMP_6,
58 JUMP_7,
59 JUMP_8,
60 JUMP_9,
61 JUMP_CONFIRM_TURN_TRANSPONDER_ON,
62 JUMP_CONFIRM,
63 STABILIZE,
64 RETRIEVE_ANCHOR,
65 RETRIEVE_ANCHOR_CONFIRM,
66 LEAVE,
67 }
68
69 private InteractionDialogAPI dialog;
70 private TextPanelAPI textPanel;
71 private OptionPanelAPI options;
72 private VisualPanelAPI visual;
73
74 private CampaignFleetAPI playerFleet;
75 private JumpPointAPI jumpPoint;
76
77 protected boolean shownConfirm = false;
78 protected boolean canAfford;
79
80 protected OptionId beingConfirmed = null;
81
82 private List<OptionId> jumpOptions = Arrays.asList(
83 new OptionId [] {
84 OptionId.JUMP_1,
85 OptionId.JUMP_2,
86 OptionId.JUMP_3,
87 OptionId.JUMP_4,
88 OptionId.JUMP_5,
89 OptionId.JUMP_6,
90 OptionId.JUMP_7,
91 OptionId.JUMP_8,
92 OptionId.JUMP_9
93 });
94
95
96 private static final Color HIGHLIGHT_COLOR = Global.getSettings().getColor("buttonShortcut");
97
98 public void init(InteractionDialogAPI dialog) {
99 this.dialog = dialog;
100 textPanel = dialog.getTextPanel();
101 options = dialog.getOptionPanel();
102 visual = dialog.getVisualPanel();
103
104 playerFleet = Global.getSector().getPlayerFleet();
105 jumpPoint = (JumpPointAPI) (dialog.getInteractionTarget());
106
108 float rounded = Math.round(fuelCost);
109 if (fuelCost > 0 && rounded <= 0) rounded = 1;
110 fuelCost = rounded;
111
112 if (isWormhole()) {
114 } else if (jumpPoint.isInHyperspace()) {
115 fuelCost = 0f;
116 }
117
118 canAfford = fuelCost <= playerFleet.getCargo().getFuel();
119
120 visual.setVisualFade(0.25f, 0.25f);
121 if (jumpPoint.getCustomInteractionDialogImageVisual() != null) {
123 } else {
124 if (isWormhole()) {
125 visual.showImagePortion("illustrations", "jump_point_wormhole", 640, 400, 0, 0, 480, 300);
126 } else {
127 if (playerFleet.getContainingLocation().isHyperspace()) {
128 visual.showImagePortion("illustrations", "jump_point_hyper", 640, 400, 0, 0, 480, 300);
129 } else {
130 visual.showImagePortion("illustrations", "jump_point_normal", 640, 400, 0, 0, 480, 300);
131 }
132 }
133 }
134
135// dialog.hideVisualPanel();
136// dialog.setTextWidth(1000);
137
138 dialog.setOptionOnEscape("Leave", OptionId.LEAVE);
139
140 optionSelected(null, OptionId.INIT);
141 }
142
143 public Map<String, MemoryAPI> getMemoryMap() {
144 return null;
145 }
146
147 private EngagementResultAPI lastResult = null;
149 // no combat here, so this won't get called
150 }
151
152 public void optionSelected(String text, Object optionData) {
153 if (optionData == null) return;
154
155 if (DumpMemory.OPTION_ID == optionData) {
156 Map<String, MemoryAPI> memoryMap = new HashMap<String, MemoryAPI>();
157 MemoryAPI memory = dialog.getInteractionTarget().getMemory();
158
159 memoryMap.put(MemKeys.LOCAL, memory);
160 if (dialog.getInteractionTarget().getFaction() != null) {
161 memoryMap.put(MemKeys.FACTION, dialog.getInteractionTarget().getFaction().getMemory());
162 } else {
163 memoryMap.put(MemKeys.FACTION, Global.getFactory().createMemory());
164 }
165 memoryMap.put(MemKeys.GLOBAL, Global.getSector().getMemory());
167
168 if (dialog.getInteractionTarget().getMarket() != null) {
169 memoryMap.put(MemKeys.MARKET, dialog.getInteractionTarget().getMarket().getMemory());
170 }
171 new DumpMemory().execute(null, dialog, null, memoryMap);
172 return;
173 } else if (DevMenuOptions.isDevOption(optionData)) {
174 DevMenuOptions.execute(dialog, (String) optionData);
175 return;
176 }
177
178 OptionId option = (OptionId) optionData;
179
180 if (text != null) {
181 //textPanel.addParagraph(text, Global.getSettings().getColor("buttonText"));
182 dialog.addOptionSelectedText(option);
183 }
184
185
186 boolean unstable = jumpPoint.getMemoryWithoutUpdate().getBoolean(UNSTABLE_KEY);
187 boolean stabilizing = jumpPoint.getMemoryWithoutUpdate().getExpire(UNSTABLE_KEY) > 0;
188 boolean canStabilize = jumpPoint.getMemoryWithoutUpdate().getBoolean(CAN_STABILIZE);
189 boolean canTransverseJump = Global.getSector().getPlayerFleet().hasAbility(Abilities.TRANSVERSE_JUMP);
190 boolean tutorialInProgress = TutorialMissionIntel.isTutorialInProgress();
191
192 switch (option) {
193 case INIT:
194// dialog.showCustomDialog(600, 400, new CustomDialogDelegate() {
195// public boolean hasCancelButton() {
196// return false;
197// }
198// public CustomUIPanelPlugin getCustomPanelPlugin() {
199// return new ExampleCustomUIPanel();
200// }
201// public String getConfirmText() {
202// return null;
203// }
204// public String getCancelText() {
205// return null;
206// }
207// public void customDialogConfirm() {
208// System.out.println("CUSTOM Confirmed");
209// }
210// public void customDialogCancel() {
211// System.out.println("CUSTOM Cancelled");
212// }
213// public void createCustomDialog(CustomPanelAPI panel) {
214// TooltipMakerAPI text = panel.createUIElement(600f, 200f, true);
215// for (int i = 0; i < 10; i++) {
216// text.addPara("The large amount of kinetic energy delivered to shield systems of enemy craft at close-range typically causes emitter overload, a tactical option often overlooked by inexperienced captains.", 10f);
217// }
218// panel.addUIElement(text).inTL(0, 0);
219// }
220// });
221
222 if (isWormhole()) {
223 addText("Your fleet approaches the wormhole.");
224 } else {
225 addText(getString("approach"));
226 }
227
228 Description desc = Global.getSettings().getDescription(jumpPoint.getCustomDescriptionId(), Type.CUSTOM);
229 if (desc != null && desc.hasText3()) {
230 addText(desc.getText3());
231 }
232
233 String noun = "jump-point";
234 if (isWormhole()) noun = "wormhole";
235
236 if (unstable) {
237 if (isWormhole() && stabilizing) {
238 float dur = jumpPoint.getMemoryWithoutUpdate().getExpire(UNSTABLE_KEY);
239
240 if (true) {
241 String durStr = "" + (int) dur;
242 String days = "days";
243 if ((int)dur == 1) {
244 days = "day";
245 }
246 if ((int)dur <= 0) {
247 days = "day";
248 durStr = "1";
249 }
250
251 textPanel.addPara("This wormhole is stabilizing and will become usable "
252 + "within %s " + days + ".", Misc.getHighlightColor(), durStr);
253 } else {
254 String time = Misc.getStringForDays((int) dur);
255 LabelAPI label;
256 if (time.contains("many")) {
257 label = textPanel.addParagraph(
258 "This wormhole is gradually stabilizing, but will not be usable for " + time + ".");
259 } else {
260 label = textPanel.addParagraph(
261 "This wormhole is stabilizing, and should be usable within " + time + ".");
262 }
263
264 label.setHighlightColor(HIGHLIGHT_COLOR);
265 label.setHighlight(time);
266 }
267
268 } else {
269 if (stabilizing && !canTransverseJump) {
270 if (tutorialInProgress) {
271 addText("This jump-point is stabilizing and should be usable within a day at the most.");
272 } else {
273 addText("This jump-point is stabilizing but will not be usable for some time.");
274 }
275 } else {
276 addText("This jump-point is unstable and can not be used.");
277 }
278
279 if (canTransverseJump && !tutorialInProgress ) {
280 addText("Until it restabilizes, hyperspace is only accessible via Transverse Jump.");
281 }
282 }
283 } else {
284 if (!jumpPoint.isInHyperspace()) {
285 if (canAfford) {
286 if (!jumpPoint.getDestinations().isEmpty()) {
287 if (isWormhole()) {
288 addText("The nav computer pings the wormhole terminus, establishing a data connection through drive-field fluctuations. "
289 + "In under a minute, and only a moment of unease as the agrav self-correction settles, the process is complete. "
290 + "Your primary interface unveils a list of possible destinations.");
291 }
292 }
293 textPanel.addParagraph("Activating this " + noun + " to let your fleet pass through will cost " + (int)fuelCost + " fuel.");
294 textPanel.highlightInLastPara(Misc.getHighlightColor(), "" + (int)fuelCost);
295 } else {
296 int fuel = (int) playerFleet.getCargo().getFuel();
297 if (fuel == 0) {
298 textPanel.addParagraph("Activating this " + noun + " to let your fleet pass through will cost " + (int)fuelCost + " fuel. You have no fuel.");
299 } else {
300 textPanel.addParagraph("Activating this " + noun + " to let your fleet pass through will cost " + (int)fuelCost + " fuel. You only have " + fuel + " fuel.");
301 }
302 textPanel.highlightInLastPara(Misc.getNegativeHighlightColor(), "" + (int)fuelCost, "" + fuel);
303 }
304 }
305
306 if (canAfford) {
308 }
309 }
310
311 if (isWormhole()) {
312 MiscCMD.addWormholeIntelIfNeeded(jumpPoint, textPanel, false);
313 }
314
315 createInitialOptions();
316 break;
317 case STABILIZE:
319 //jumpPoint.getMemoryWithoutUpdate().unset(UNSTABLE_KEY);
321
322 addText("You load the stabilization algorithm into your jump program and the drive field goes through a series " +
323 "of esoteric fluctuations, their resonance gradually cancelling out the instability in this jump-point.");
324
325 addText("The jump-point should be stable enough to use within a day or so.");
326
327 createInitialOptions();
328 break;
329 case JUMP_CONFIRM_TURN_TRANSPONDER_ON:
331 if (t != null && !t.isActive()) {
332 t.activate();
333 }
335 break;
336 case JUMP_CONFIRM:
338 break;
339 case RETRIEVE_ANCHOR_CONFIRM:
340 dialog.getTextPanel().addPara(
341 "You give the order. Before long, your ops chief confirms that the wormhole anchor has been stowed in a secure hold on your flagship.");
342 WormholeManager.get().removeWormhole(jumpPoint, dialog);
343 options.clearOptions();
344 options.addOption("Leave", OptionId.LEAVE, null);
345 options.setShortcut(OptionId.LEAVE, Keyboard.KEY_ESCAPE, false, false, false, true);
346 break;
347 case RETRIEVE_ANCHOR:
348 dialog.getTextPanel().addPara(
349 "This will shut down the wormhole and free up the stable point for other uses.");
350 options.clearOptions();
351 options.addOption("Confirm your orders", OptionId.RETRIEVE_ANCHOR_CONFIRM, null);
352
353 options.addOption("Abort the operation", OptionId.LEAVE, null);
354 options.setShortcut(OptionId.LEAVE, Keyboard.KEY_ESCAPE, false, false, false, true);
355 break;
356 case LEAVE:
358 Global.getSector().setPaused(false);
359 dialog.dismiss();
360 break;
361 }
362
363 if (jumpOptions.contains(option)) {
364 JumpDestination dest = destinationMap.get(option);
365 if (dest != null) {
366
367 if (!shownConfirm) {
368 SectorEntityToken target = dest.getDestination();
370 if (target != null && target.getContainingLocation() != null &&
371 !target.getContainingLocation().isHyperspace() && !player.isTransponderOn()) {
372 List<FactionAPI> wouldBecomeHostile = TransponderAbility.getFactionsThatWouldBecomeHostile(player);
373 boolean wouldMindTOff = false;
374 boolean isPopulated = false;
376 if (market.isHidden()) continue;
377 if (market.getFaction().isPlayerFaction()) continue;
378
379 isPopulated = true;
380 if (!market.getFaction().isHostileTo(Factions.PLAYER) &&
381 !market.isFreePort() &&
382 !market.getFaction().getCustomBoolean(Factions.CUSTOM_ALLOWS_TRANSPONDER_OFF_TRADE)) {
383 wouldMindTOff = true;
384 }
385 }
386
387 if (isPopulated) {
388 if (wouldMindTOff) {
389 textPanel.addPara("Your transponder is off, and patrols " +
390 "in the " +
392 " are likely to give you trouble over the fact, if you're spotted.");
393 } else {
394 textPanel.addPara("Your transponder is off, but any patrols in the " +
396 " are unlikely to raise the issue.");
397 }
398
399 if (!wouldBecomeHostile.isEmpty()) {
400 String str = "Turning the transponder on now would reveal your hostile actions to";
401 boolean first = true;
402 boolean last = false;
403 for (FactionAPI faction : wouldBecomeHostile) {
404 last = wouldBecomeHostile.indexOf(faction) == wouldBecomeHostile.size() - 1;
405 if (first || !last) {
406 str += " " + faction.getDisplayNameWithArticle() + ",";
407 } else {
408 str += " and " + faction.getDisplayNameWithArticle() + ",";
409 }
410 }
411 str = str.substring(0, str.length() - 1) + ".";
412 textPanel.addPara(str, Misc.getNegativeHighlightColor());
413 }
414
415 options.clearOptions();
416
417 options.addOption("Turn the transponder on and then jump", OptionId.JUMP_CONFIRM_TURN_TRANSPONDER_ON, null);
418 options.addOption("Jump, keeping the transponder off", OptionId.JUMP_CONFIRM, null);
419 beingConfirmed = option;
420
421 options.addOption("Abort the jump", OptionId.LEAVE, null);
422 options.setShortcut(OptionId.LEAVE, Keyboard.KEY_ESCAPE, false, false, false, true);
423
424 shownConfirm = true;
425 return;
426 }
427 }
428 }
429
430
431
432
433// SectorEntityToken token = dest.getDestination();
434// //System.out.println("JUMP SELECTED");
435// LocationAPI destLoc = token.getContainingLocation();
436// LocationAPI curr = playerFleet.getContainingLocation();
437//
438// Global.getSector().setCurrentLocation(destLoc);
439// curr.removeEntity(playerFleet);
440// destLoc.addEntity(playerFleet);
441//
442// Global.getSector().setPaused(false);
443// playerFleet.setLocation(token.getLocation().x, token.getLocation().y);
444// playerFleet.setMoveDestination(token.getLocation().x, token.getLocation().y);
445
448 }
449
450 dialog.dismiss();
451
452 Global.getSector().setPaused(false);
453 Global.getSector().doHyperspaceTransition(playerFleet, jumpPoint, dest);
454
455 playerFleet.getCargo().removeFuel(fuelCost);
456
457 return;
458 }
459 }
460 }
461
462 protected void showWarningIfNeeded() {
463 if (isWormhole()) return;
464
465 if (jumpPoint.getDestinations().isEmpty()) return;
466 JumpDestination dest = jumpPoint.getDestinations().get(0);
467 SectorEntityToken target = dest.getDestination();
468 if (target == null || target.getContainingLocation() == null) return;
469
470 List<CampaignFleetAPI> fleets = new ArrayList<CampaignFleetAPI>();
471 boolean hostile = false;
472 float minDist = Float.MAX_VALUE;
473 int maxDanger = 0;
474 for (CampaignFleetAPI other : target.getContainingLocation().getFleets()) {
475 float dist = Misc.getDistance(target, other);
476 if (dist < 1000) {
477 fleets.add(other);
478 if (other.getAI() != null) {
479 hostile |= other.getAI().isHostileTo(Global.getSector().getPlayerFleet());
480 } else {
481 hostile |= other.getFaction().isHostileTo(Factions.PLAYER);
482 }
483 if (other.getMemoryWithoutUpdate().getBoolean(MemFlags.MEMORY_KEY_PIRATE)) {
484 hostile = true;
485 }
486 if (hostile) {
487 maxDanger = Math.max(maxDanger, Misc.getDangerLevel(other));
488 }
489 if (dist < minDist) minDist = dist;
490 }
491 }
492 TextPanelAPI text = dialog.getTextPanel();
493
494 if (maxDanger >= 2) {
495 String noun = "jump-point";
496 if (isWormhole()) noun = "wormhole";
497 text.addPara("Warning!", Misc.getNegativeHighlightColor());
498 Global.getSoundPlayer().playUISound("cr_playership_malfunction", 1f, 0.25f);
499
500 String where = "a short distance away from the exit";
501 String whereHL = "";
502 if (minDist < 300) {
503 where = "extremely close to the exit";
504 whereHL = where;
505 }
506 text.addPara("The jump-point exhibits fluctuations " +
507 "characteristic of drive field activity " + where + ".",
509
510 text.addPara("A disposable probe sends back a microburst of information: forces " +
511 "near the exit are assesed likely hostile and a possible threat to your fleet.",
512 Misc.getNegativeHighlightColor(), "hostile", "threat");
513 }
514 }
515
516 private Map<OptionId, JumpDestination> destinationMap = new HashMap<OptionId, JumpDestination>();
517 private void createInitialOptions() {
518 options.clearOptions();
519
520 boolean dev = Global.getSettings().isDevMode();
521 float navigation = Global.getSector().getPlayerFleet().getCommanderStats().getSkillLevel("navigation");
522 boolean isStarAnchor = jumpPoint.isStarAnchor();
523 boolean okToUseIfAnchor = isStarAnchor && navigation >= 7;
524
525 okToUseIfAnchor = true;
526 if (isStarAnchor && !okToUseIfAnchor && dev) {
527 addText("(Can always be used in dev mode)");
528 }
529 okToUseIfAnchor |= dev;
530
531 String noun = "jump-point";
532 if (isWormhole()) noun = "wormhole";
533
534 boolean unstable = jumpPoint.getMemoryWithoutUpdate().getBoolean(UNSTABLE_KEY);
535 boolean canStabilize = jumpPoint.getMemoryWithoutUpdate().getBoolean(CAN_STABILIZE);
536
537 if (unstable) {
538 if (canStabilize) {
539 options.addOption("Stabilize the jump-point", OptionId.STABILIZE, null);
540 }
541 } else {
542 if (jumpPoint.getDestinations().isEmpty()) {
543 if (isWormhole()) {
544 addText("This wormhole is not connected to any other termini and is effectively unusable.");
545 } else {
546 addText(getString("noExits"));
547 }
548 } else if (playerFleet.getCargo().getFuel() <= 0 && !canAfford) {
549 //addText(getString("noFuel"));
550 } else if (isStarAnchor && !okToUseIfAnchor) {
551 addText(getString("starAnchorUnusable"));
552 } else if (canAfford) {
553 int index = 0;
554 for (JumpDestination dest : jumpPoint.getDestinations()) {
555 if (index >= jumpOptions.size()) break;
556 OptionId option = jumpOptions.get(index);
557 index++;
558
559 if (isWormhole()) {
560 options.addOption("Initiate a transit to " + dest.getLabelInInteractionDialog(), option, null);
561
562 boolean canUse = WormholeScannerPlugin.canPlayerUseWormholes();
563 if (!canUse) {
564 options.setEnabled(option, false);
565 options.setTooltip(option, "Using a wormhole requires a wormhole scanner.");
566 }
567
568 } else {
569 options.addOption("Order a jump to " + dest.getLabelInInteractionDialog(), option, null);
570 }
571 destinationMap.put(option, dest);
572 }
573 }
574 }
575
576 if (isWormhole()) {
577 options.addOption("Shut down the wormhole and retrieve the anchor", OptionId.RETRIEVE_ANCHOR, null);
578 }
579
580 options.addOption("Leave", OptionId.LEAVE, null);
581 options.setShortcut(OptionId.LEAVE, Keyboard.KEY_ESCAPE, false, false, false, true);
582
583 if (Global.getSettings().getBoolean("oneClickJumpPoints")) {
584 if (jumpPoint.getDestinations().size() == 1) {
585 dialog.setOpacity(0);
586 dialog.setBackgroundDimAmount(0f);
587 optionSelected(null, OptionId.JUMP_1);
588 }
589 }
590
591 if (Global.getSettings().isDevMode()) {
592 DevMenuOptions.addOptions(dialog);
593 }
594 }
595
596
597 protected OptionId lastOptionMousedOver = null;
598 protected float fuelCost;
599
600 public void optionMousedOver(String optionText, Object optionData) {
601
602 }
603
604 public void advance(float amount) {
605
606 }
607
608 private void addText(String text) {
609 textPanel.addParagraph(text);
610 }
611
612 private void appendText(String text) {
613 textPanel.appendToLastParagraph(" " + text);
614 }
615
616 private String getString(String id) {
617 String str = Global.getSettings().getString("jumpPointInteractionDialog", id);
618
619 String fleetOrShip = "fleet";
620 if (playerFleet.getFleetData().getMembersListCopy().size() == 1) {
621 fleetOrShip = "ship";
622 if (playerFleet.getFleetData().getMembersListCopy().get(0).isFighterWing()) {
623 fleetOrShip = "fighter wing";
624 }
625 }
626 str = str.replaceAll("\\$fleetOrShip", fleetOrShip);
627
628 return str;
629 }
630
631
632 public Object getContext() {
633 return null;
634 }
635
636 public boolean isWormhole() {
637 return jumpPoint.isWormhole();
638 }
639}
640
641
642
static SettingsAPI getSettings()
Definition Global.java:57
static SoundPlayerAPI getSoundPlayer()
Definition Global.java:49
static FactoryAPI getFactory()
Definition Global.java:41
static SectorAPI getSector()
Definition Global.java:65
static void execute(InteractionDialogAPI dialog, String option)
static boolean isDevOption(Object optionData)
static final String CUSTOM_ALLOWS_TRANSPONDER_OFF_TRADE
Definition Factions.java:54
boolean execute(String ruleId, InteractionDialogAPI dialog, List< Token > params, Map< String, MemoryAPI > memoryMap)
static void addWormholeIntelIfNeeded(SectorEntityToken entity, TextPanelAPI textPanel, boolean deployed)
Definition MiscCMD.java:112
void removeWormhole(JumpPointAPI jp, InteractionDialogAPI dialog)
static int getDangerLevel(CampaignFleetAPI fleet)
Definition Misc.java:5326
static Color getNegativeHighlightColor()
Definition Misc.java:802
static String getStringForDays(int days)
Definition Misc.java:1608
static float getDistance(SectorEntityToken from, SectorEntityToken to)
Definition Misc.java:599
static Color getHighlightColor()
Definition Misc.java:792
Description getDescription(String id, Type type)
String getString(String category, String id)
SoundAPI playUISound(String id, float pitch, float volume)
MutableCharacterStatsAPI getCommanderStats()
void setFollowingDirectCommand(boolean followingDirectCommand)
List< FleetMemberAPI > getMembersListCopy()
void setBackgroundDimAmount(float backgroundDimAmount)
void setOptionOnEscape(String text, Object optionId)
List< JumpDestination > getDestinations()
List< CampaignFleetAPI > getFleets()
void setTooltip(Object data, String tooltipText)
void addOption(String text, Object data)
void setEnabled(Object data, boolean enabled)
void setShortcut(Object data, int code, boolean ctrl, boolean alt, boolean shift, boolean putLast)
void doHyperspaceTransition(CampaignFleetAPI fleet, SectorEntityToken jumpLocation, JumpDestination dest)
InteractionDialogImageVisual getCustomInteractionDialogImageVisual()
void highlightInLastPara(Color color, String ...strings)
void setVisualFade(float in, float out)
void showImagePortion(String category, String id, float x, float y, float w, float h, float xOffset, float yOffset, float displayWidth, float displayHeight)
void showImageVisual(InteractionDialogImageVisual visual)
List< MarketAPI > getMarkets(LocationAPI loc)
void expire(String key, float days)
void setHighlight(int start, int end)
void setHighlightColor(Color color)