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