001package com.fs.starfarer.api.campaign;
002
003import java.awt.Color;
004import java.util.List;
005
006import com.fs.starfarer.api.campaign.CampaignUIAPI.CoreUITradeMode;
007import com.fs.starfarer.api.campaign.econ.Industry;
008import com.fs.starfarer.api.campaign.econ.MarketAPI;
009import com.fs.starfarer.api.combat.BattleCreationContext;
010import com.fs.starfarer.api.fleet.FleetMemberAPI;
011import com.fs.starfarer.api.impl.campaign.graid.GroundRaidObjectivePlugin;
012
013
014public interface InteractionDialogAPI {
015
016        void setTextWidth(float width);
017        void setTextHeight(float height);
018        void setXOffset(float xOffset);
019        void setYOffset(float yOffset);
020        void setPromptText(String promptText);
021        
022        void hideTextPanel();
023        void showTextPanel();
024        
025        float getTextWidth();
026        float getTextHeight();
027        float getXOffset();
028        float getYOffset();
029        String getPromptText();
030        
031        void flickerStatic(float in, float out);
032
033        OptionPanelAPI getOptionPanel();
034        TextPanelAPI getTextPanel();
035        VisualPanelAPI getVisualPanel();
036        
037        SectorEntityToken getInteractionTarget();
038        
039        InteractionDialogPlugin getPlugin();
040
041
042        /**
043         * optionSelected() with these parameters will be called when the player presses
044         * "escape" while in the dialog, as the dialog is being dismissed.
045         * 
046         * Can be set to null to have the escape key do nothing.
047         * @param text
048         * @param optionId
049         */
050        void setOptionOnEscape(String text, Object optionId);
051
052        void startBattle(BattleCreationContext context);
053        void dismiss();
054        void dismissAsCancel();
055        
056        void showFleetMemberPickerDialog(String title, String okText, String cancelText,
057                                                                         int rows, int cols, float iconSize, boolean canPickNotReady, boolean canPickMultiple,
058                                                                         List<FleetMemberAPI> pool, FleetMemberPickerListener listener);
059        
060        void showCustomDialog(float customPanelWidth, float customPanelHeight, CustomDialogDelegate delegate);
061        
062        
063        
064//      /**
065//       * Temporary hack, to be used until proper dialog mechanics are in.
066//       * Doesn't belong in this interface conceptually (hence "hack").
067//       * @param context
068//       * @param playerFleet
069//       * @param otherFleet
070//       * @return
071//       */
072//      String getNPCText(FleetEncounterContextPlugin context, CampaignFleetAPI playerFleet, CampaignFleetAPI otherFleet);
073        
074        void hideVisualPanel();
075        
076        void showCommDirectoryDialog(CommDirectoryAPI dir);
077        void setOptionOnConfirm(String text, Object optionId);
078        void setOpacity(float opacity);
079        void setBackgroundDimAmount(float backgroundDimAmount);
080        
081        void setPlugin(InteractionDialogPlugin plugin);
082        void setInteractionTarget(SectorEntityToken interactionTarget);
083        void showCargoPickerDialog(String title, String okText, String cancelText, 
084                        boolean small, float textPanelWidth, CargoAPI cargo, CargoPickerListener listener);
085        void showIndustryPicker(String title, String okText, MarketAPI market,
086                                                List<Industry> industries, IndustryPickerListener listener);
087        
088        void makeOptionOpenCore(String optionId, CoreUITabId tabId, CoreUITradeMode mode);
089        void makeOptionOpenCore(String optionId, CoreUITabId tabId, CoreUITradeMode mode, boolean onlyShowTargetTabShortcut);
090        
091        void setOptionColor(Object optionId, Color color);
092        void makeStoryOption(Object optionId, int storyPoints, float bonusXPFraction, String soundId);
093        void addOptionSelectedText(Object optionId);
094        void addOptionSelectedText(Object optionId, boolean allowPrintingStoryOption);
095        
096        void showFleetMemberRecoveryDialog(String title, List<FleetMemberAPI> pool, FleetMemberPickerListener listener);
097        void showFleetMemberRecoveryDialog(String title,
098                                                                           List<FleetMemberAPI> pool, List<FleetMemberAPI> storyPool,
099                                                                           FleetMemberPickerListener listener);
100        void showGroundRaidTargetPicker(String title, String okText, MarketAPI market, List<GroundRaidObjectivePlugin> data, GroundRaidTargetPickerDelegate listener);
101        void showVisualPanel();
102        void showCustomProductionPicker(CustomProductionPickerDelegate delegate);
103        void showCampaignEntityPicker(String title, String selectedText, String okText, FactionAPI factionForUIColors,
104                                                          List<SectorEntityToken> entities, CampaignEntityPickerListener listener);
105        boolean isCurrentOptionHadAConfirm();
106        void showCustomVisualDialog(float customPanelWidth, float customPanelHeight, CustomVisualDialogDelegate delegate);
107        void showCargoPickerDialog(String title, String okText, String cancelText, boolean small, float textPanelWidth,
108                        float width, float height, CargoAPI cargo, CargoPickerListener listener);
109
110}
111
112
113