Starsector API
Loading...
Searching...
No Matches
TutorialGoSlowDialogPluginImpl.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 ;
23 }
24
29
31
34
36 this.dialog = dialog;
40
42
43 //visual.showImagePortion("illustrations", "jump_point_hyper", 640, 400, 0, 0, 480, 300);
44 visual.showFleetInfo("Your fleet", playerFleet, null, null);
45
46 //dialog.setOptionOnEscape("Leave", OptionId.LEAVE);
47
48 optionSelected(null, OptionId.INIT);
49 }
50
51 public Map<String, MemoryAPI> getMemoryMap() {
52 return null;
53 }
54
56 // no combat here, so this won't get called
57 }
58
59 public void optionSelected(String text, Object optionData) {
60 if (optionData == null) return;
61
62 OptionId option = (OptionId) optionData;
63
64 if (text != null) {
65 //textPanel.addParagraph(text, Global.getSettings().getColor("buttonText"));
67 }
68
69
70 String control = Global.getSettings().getControlStringForEnumName("GO_SLOW");
71
72 switch (option) {
73 case INIT:
74 textPanel.addParagraph("You're coming up on an asteroid belt!");
75
76 textPanel.addParagraph("If you go through at full speed, there's a chance your fleet may be knocked off course, " +
77 "and some of your ships might even suffer damage from asteroid impacts.");
78
80 options.addOption("Continue", OptionId.CONT1, null);
81 break;
82 case CONT1:
83 textPanel.addPara("A slow-moving fleet avoids this danger. Press and hold %s to move slowly, until " +
84 "you're through the asteroid belt.",
85 Misc.getHighlightColor(), control);
86
87 textPanel.addPara("The danger is low, however - especially since the belt is thin, " +
88 "and you're only going across it - so you could also get away with just going full speed.");
90 options.addOption("Continue", OptionId.CONT2, null);
91 break;
92 case CONT2:
93 Global.getSector().setPaused(false);
95 break;
96 }
97 }
98
99
100
101
102 public void optionMousedOver(String optionText, Object optionData) {
103
104 }
105
106 public void advance(float amount) {
107
108 }
109
110 public Object getContext() {
111 return null;
112 }
113}
114
115
116
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)