Starsector API
Loading...
Searching...
No Matches
TutorialPirateApproachesDialogPluginImpl.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.tutorial;
2
3import java.util.Map;
4
5import com.fs.starfarer.api.Global;
6import com.fs.starfarer.api.campaign.CampaignFleetAPI;
7import com.fs.starfarer.api.campaign.InteractionDialogAPI;
8import com.fs.starfarer.api.campaign.InteractionDialogPlugin;
9import com.fs.starfarer.api.campaign.OptionPanelAPI;
10import com.fs.starfarer.api.campaign.TextPanelAPI;
11import com.fs.starfarer.api.campaign.VisualPanelAPI;
12import com.fs.starfarer.api.campaign.rules.MemoryAPI;
13import com.fs.starfarer.api.combat.EngagementResultAPI;
14import com.fs.starfarer.api.util.Misc;
15
17
18 public static enum OptionId {
19 INIT,
20 CONT1,
21 CONT2,
22 CONT3,
23 CONT4,
24 ;
25 }
26
31
33
35 this.dialog = dialog;
39
41
42 //visual.showImagePortion("illustrations", "jump_point_hyper", 640, 400, 0, 0, 480, 300);
43 visual.showFleetInfo("Your fleet", playerFleet, null, null);
44
45 //dialog.setOptionOnEscape("Leave", OptionId.LEAVE);
46
47 optionSelected(null, OptionId.INIT);
48 }
49
50 public Map<String, MemoryAPI> getMemoryMap() {
51 return null;
52 }
53
55 // no combat here, so this won't get called
56 }
57
58 public void optionSelected(String text, Object optionData) {
59 if (optionData == null) return;
60
61 OptionId option = (OptionId) optionData;
62
63 if (text != null) {
64 //textPanel.addParagraph(text, Global.getSettings().getColor("buttonText"));
66 }
67
68
69 switch (option) {
70 case INIT:
71 textPanel.addParagraph("A pirate fleet is approaching! First you'll spot it as a sensor contact, " +
72 "then as an unidentified fleet, and then - when it gets very close - you'll see its true colors.");
73
75 options.addOption("Continue", OptionId.CONT1, null);
76 break;
77 case CONT1:
78
79 String load = Global.getSettings().getControlStringForEnumName("QUICK_LOAD");
80
81 textPanel.addPara("Don't worry - the pirate ship is a shoddy rust bucket, " +
82 "and if you do lose, you can press %s to quick-load.",
83 Misc.getHighlightColor(), load);
84
86 options.addOption("Continue", OptionId.CONT2, null);
87 break;
88 case CONT2:
89 textPanel.addParagraph("Even so, combat can be expensive, especially if there's no bounty on the enemy you fight. " +
90 "Deploying ships into battle reduces their combat readiness, and recovering CR consumes supplies. " +
91 "Battle damage can cost even more supplies to repair.");
92
94 options.addOption("Continue", OptionId.CONT3, null);
95 break;
96 case CONT3:
97 textPanel.addParagraph("However, fighting is often necessary to survive. Wait for the pirate fleet to approach, then defeat them!");
98
100 options.addOption("Finish", OptionId.CONT4, null);
101 break;
102 case CONT4:
103 Global.getSector().setPaused(false);
104 dialog.dismiss();
105 break;
106 }
107 }
108
109
110
111
112 public void optionMousedOver(String optionText, Object optionData) {
113
114 }
115
116 public void advance(float amount) {
117
118 }
119
120 public Object getContext() {
121 return null;
122 }
123}
124
125
126
static SettingsAPI getSettings()
Definition Global.java:57
static SectorAPI getSector()
Definition Global.java:65
static Color getHighlightColor()
Definition Misc.java:792
String getControlStringForEnumName(String name)
void addOption(String text, Object data)
void showFleetInfo(String titleOne, CampaignFleetAPI one, String titleTwo, CampaignFleetAPI two)