001package com.fs.starfarer.api.campaign;
002
003import java.util.List;
004
005import java.awt.Color;
006
007import com.fs.starfarer.api.Script;
008import com.fs.starfarer.api.campaign.comm.CommMessageAPI.MessageClickAction;
009import com.fs.starfarer.api.campaign.comm.IntelInfoPlugin;
010import com.fs.starfarer.api.combat.BattleCreationContext;
011import com.fs.starfarer.api.loading.HullModSpecAPI;
012import com.fs.starfarer.api.ui.HintPanelAPI;
013import com.fs.starfarer.api.util.FaderUtil;
014
015public interface CampaignUIAPI {
016        public static enum CoreUITradeMode {
017                OPEN,
018                SNEAK,
019                NONE,
020        }
021        
022        public static interface DismissDialogDelegate {
023                void dialogDismissed();
024        }
025        
026        MessageDisplayAPI getMessageDisplay();
027        
028        void addMessage(String text);
029        void addMessage(String text, Color color);
030        void addMessage(String text, Color color, String h1, String h2, Color hc1, Color hc2);
031        
032        void clearMessages();
033        
034        boolean isShowingDialog();
035        void startBattle(BattleCreationContext context);
036        
037        /**
038         * Returns true if dialog was actually shown, false otherwise (if, for example, UI is already showing another dialog).
039         * @param plugin
040         * @param interactionTarget can be null.
041         */
042        boolean showInteractionDialog(InteractionDialogPlugin plugin, SectorEntityToken interactionTarget);
043        
044        
045        /**
046         * Returns true if dialog was actually shown, false otherwise (if, for example, UI is already showing another dialog).
047         * Picks whatever dialog is appropriate based on the various plugins that provide dialog
048         * implementations.
049         * @param interactionTarget
050         */
051        boolean showInteractionDialog(SectorEntityToken interactionTarget);
052        
053        
054        void showCoreUITab(CoreUITabId tab);
055        
056        /**
057         * @param tab
058         * @param custom IntelInfoPlugin to select in intel tab, or FleetMemberAPI to select in refit tab
059         */
060        void showCoreUITab(CoreUITabId tab, Object custom);
061        
062        InteractionDialogAPI getCurrentInteractionDialog();
063
064        void setDisallowPlayerInteractionsForOneFrame();
065
066        FaderUtil getSharedFader();
067
068        //void suppressMusic();
069
070        float getZoomFactor();
071
072        void suppressMusic(float maxLevel);
073
074        boolean isShowingMenu();
075
076        void resetViewOffset();
077
078        List<HullModSpecAPI> getAvailableHullModsCopy();
079
080        boolean isHullModAvailable(String id);
081
082        List<String> getAvailableHullModIds();
083
084        HintPanelAPI getHintPanel();
085
086        void quickLoad();
087
088        CoreUITabId getCurrentCoreTab();
089
090        void cmdExitWithoutSaving();
091        boolean cmdSaveAndExit();
092        void cmdSettings();
093        void cmdSaveCopy();
094        boolean cmdSave();
095        void cmdLoad();
096        void cmdCodex();
097
098        boolean showConfirmDialog(String message, String ok, String cancel, Script onOk, Script onCancel);
099        boolean showConfirmDialog(String message, String ok, String cancel, float width, float height, Script onOk, Script onCancel);
100
101        void addMessage(IntelInfoPlugin intel);
102        void addMessage(IntelInfoPlugin intel, MessageClickAction action);
103        void addMessage(IntelInfoPlugin intel, MessageClickAction action, Object custom);
104
105        void setFollowingDirectCommand(boolean followingDirectCommand);
106        boolean isFollowingDirectCommand();
107
108        void clearLaidInCourse();
109
110        /**
111         * @return true if was shown (may not be if showing another dialog etc)
112         */
113        boolean showPlayerFactionConfigDialog();
114
115        void showHelpPopupIfPossible(String id);
116
117        /**
118         * Calls Global.getSector().getUIData().getCourseTarget(). The actual ultimate autopilot destination,
119         * not its next step.
120         * @return
121         */
122        SectorEntityToken getUltimateCourseTarget();
123        SectorEntityToken getCurrentCourseTarget();
124        SectorEntityToken getNextStepForCourse(SectorEntityToken courseTarget);
125        void layInCourseForNextStep(SectorEntityToken courseTarget);
126        String getNameForCourseTarget(SectorEntityToken entity, boolean isEndpoint);
127        float getLastLegDistance(SectorEntityToken courseTarget);
128
129        boolean isFastForward();
130
131        boolean isPlayerFleetFollowingMouse();
132
133        void showMessageDialog(String message);
134
135        float getMinZoomFactor();
136        float getMaxZoomFactor();
137        void setMinZoomFactor(float min);
138        void setMaxZoomFactor(float max);
139
140        boolean isSuppressFuelRangeRenderingOneFrame();
141        void setSuppressFuelRangeRenderingOneFrame(boolean suppressFuelRangeRenderingOneFrame);
142
143        int getMaxIntelMapIcons();
144        void setMaxIntelMapIcons(int maxIntelMapIcons);
145
146        boolean isHideUI();
147        void setHideUI(boolean hideUI);
148
149        void setZoomFactor(float zoomFactor);
150
151        /**
152         * If the game is currently showing a dialog of any ort: does not do anything.
153         */
154        void autosave();
155
156        boolean showInteractionDialogFromCargo(InteractionDialogPlugin plugin, SectorEntityToken interactionTarget, DismissDialogDelegate delegate);
157
158        void restartEncounterMusic(SectorEntityToken interactionTarget);
159
160
161}
162
163
164
165