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;
41 List<IndustryOptionData> result =
new ArrayList<IndustryOptionData>();
44 opt.color = Color.GREEN;
48 opt.color = Color.MAGENTA;
52 opt.color = Color.ORANGE;
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);
107 ui.
showDialog(station,
"OpenInteractionDialog");
111 public void createCustomDialog(
CustomPanelAPI panel, CustomDialogCallback callback) {
113 info.
addPara(
"Minimalistic custom dialog implementation.", 0f);
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",
136 "Performed a test action in TestIndustryOptionProvider");
139 public void confirm() {
143 public String getTitle() {
149 info.
addPara(
"Test action that costs one story point.", -10f);
151 super.createDescription(info);
156 System.out.println(
"IMMEDIATE ACTION TAKEN");
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 setUnpauseOnExit(boolean unpauseOnExit)
static final String POPULATION
static String STORY_POINT_SPEND
static Color getStoryOptionColor()
StarSystemAPI getStarSystem(String name)
SectorEntityToken getEntityById(String id)
void showDialog(SectorEntityToken target, InteractionDialogPlugin plugin)
TooltipMakerAPI createUIElement(float width, float height, boolean withScroller)
PositionAPI addUIElement(TooltipMakerAPI element)
PositionAPI inTL(float xPad, float yPad)