1package com.fs.starfarer.api.campaign.listeners;
4import java.util.ArrayList;
7import com.fs.starfarer.api.Global;
8import com.fs.starfarer.api.campaign.BaseCustomDialogDelegate;
9import com.fs.starfarer.api.campaign.CustomDialogDelegate;
10import com.fs.starfarer.api.campaign.PlanetAPI;
11import com.fs.starfarer.api.campaign.SectorEntityToken;
12import com.fs.starfarer.api.campaign.StoryPointActionDelegate;
13import com.fs.starfarer.api.campaign.econ.Industry;
14import com.fs.starfarer.api.campaign.econ.Industry.IndustryTooltipMode;
15import com.fs.starfarer.api.impl.campaign.PlanetInteractionDialogPluginImpl;
16import com.fs.starfarer.api.impl.campaign.ids.Industries;
17import com.fs.starfarer.api.impl.campaign.ids.Sounds;
18import com.fs.starfarer.api.impl.campaign.rulecmd.SetStoryOption.BaseOptionStoryPointActionDelegate;
19import com.fs.starfarer.api.impl.campaign.rulecmd.SetStoryOption.StoryOptionParams;
20import com.fs.starfarer.api.ui.Alignment;
21import com.fs.starfarer.api.ui.CustomPanelAPI;
22import com.fs.starfarer.api.ui.TooltipMakerAPI;
23import com.fs.starfarer.api.util.Misc;
39 if (ind.getMarket().getId().equals(
"jangala") && ind.getId().equals(Industries.POPULATION)) {
41 List<IndustryOptionData> result =
new ArrayList<IndustryOptionData>();
44 opt.color = Color.GREEN;
48 opt.color = Color.MAGENTA;
52 opt.color = Color.ORANGE;
56 opt.color = Misc.getStoryOptionColor();
60 opt.color = Color.RED;
75 tooltip.addPara(
"This option shows a standard interaction dialog with a custom plugin. "
76 +
"In this case, the dialog used is the PlanetInteractionDialogPluginImpl,"
77 +
" with Corvus - the star - as the target.", 0f);
79 tooltip.addPara(
"This option shows a rule-driven interaction dialog. In this case, "
80 +
"the dialog targets the Asharu Terraforming Platform and fires the "
81 +
"OpenInteractionDialog trigger to start the interaction.", 0f);
83 tooltip.addPara(
"This option shows a custom dialog driven by a CustomDialogDelegate implementation.", 0f);
85 tooltip.addPara(
"This option brings up a dialog where the player may spend some number "
86 +
"of story points to perform an action, and possibly receive bonus experience.", 0f);
88 tooltip.addPara(
"This option will not show a dialog but instead prints some text to standard out.", 0f);
90 tooltip.addPara(
"This option is disabled.", 0f);
98 PlanetInteractionDialogPluginImpl plugin =
new PlanetInteractionDialogPluginImpl();
103 plugin.setUnpauseOnExit(
false);
107 ui.
showDialog(station,
"OpenInteractionDialog");
111 public void createCustomDialog(CustomPanelAPI panel, CustomDialogCallback callback) {
112 TooltipMakerAPI info = panel.createUIElement(800f, 500f,
false);
113 info.addPara(
"Minimalistic custom dialog implementation.", 0f);
114 panel.addUIElement(info).inTL(0, 0);
118 public boolean hasCancelButton() {
123 public void customDialogConfirm() {
124 System.out.println(
"customDialogConfirm() called");
128 public void customDialogCancel() {
129 System.out.println(
"customDialogCancel() called");
134 StoryOptionParams params =
new StoryOptionParams(
null, 1,
"bonusXP_if_any_in_settings.json",
135 Sounds.STORY_POINT_SPEND,
136 "Performed a test action in TestIndustryOptionProvider");
139 public void confirm() {
143 public String getTitle() {
147 public void createDescription(TooltipMakerAPI info) {
148 info.setParaInsigniaLarge();
149 info.addPara(
"Test action that costs one story point.", -10f);
156 System.out.println(
"IMMEDIATE ACTION TAKEN");
162 public void addToIndustryTooltip(Industry ind, IndustryTooltipMode mode, TooltipMakerAPI tooltip,
float width,
boolean expanded) {
166 tooltip.addSectionHeading(
"TestIndustryOptionProvider", Alignment.MID, opad);
167 tooltip.addPara(
"Information about changes made to the this industry by "
168 +
"any of the custom options would go here.", opad);
static SectorAPI getSector()
boolean isUnsuitable(Industry ind, boolean allowUnderConstruction)
void optionSelected(IndustryOptionData opt, DialogCreatorUI ui)
static Object CUSTOM_PLUGIN
static Object DISABLED_OPTION
void addToIndustryTooltip(Industry ind, IndustryTooltipMode mode, TooltipMakerAPI tooltip, float width, boolean expanded)
static Object IMMEDIATE_ACTION
static Object INTERACTION_PLUGIN
List< IndustryOptionData > getIndustryOptions(Industry ind)
static Object INTERACTION_TRIGGER
void createTooltip(IndustryOptionData opt, TooltipMakerAPI tooltip, float width)
static Object STORY_ACTION
void createDescription(TooltipMakerAPI info)
void showDialog(SectorEntityToken target, InteractionDialogPlugin plugin)