001package com.fs.starfarer.api.campaign.comm;
002
003import java.util.List;
004import java.util.Set;
005
006import java.awt.Color;
007
008import com.fs.starfarer.api.campaign.FactionAPI;
009import com.fs.starfarer.api.campaign.SectorEntityToken;
010import com.fs.starfarer.api.campaign.StoryPointActionDelegate;
011import com.fs.starfarer.api.ui.CustomPanelAPI;
012import com.fs.starfarer.api.ui.IntelUIAPI;
013import com.fs.starfarer.api.ui.SectorMapAPI;
014import com.fs.starfarer.api.ui.TooltipMakerAPI;
015import com.fs.starfarer.api.ui.UIPanelAPI;
016
017public interface IntelInfoPlugin {
018        
019        public static class TableRowClickData {
020                public Object rowId;
021                public UIPanelAPI table;
022                public TableRowClickData(Object rowId, UIPanelAPI table) {
023                        this.rowId = rowId;
024                        this.table = table;
025                }
026                
027        }
028        
029        public static enum ListInfoMode {
030                MESSAGES,
031                INTEL,
032                MAP_TOOLTIP,
033                IN_DESC, // not used from core but useful for some implementation details
034        }
035        
036        public static class ArrowData {
037                public float alphaMult = 0.33f;
038                public float width = 10f;
039                public SectorEntityToken from;
040                public SectorEntityToken to;
041                public Color color;
042                
043                public ArrowData(SectorEntityToken from, SectorEntityToken to) {
044                        this.from = from;
045                        this.to = to;
046                }
047
048                public ArrowData(float width, SectorEntityToken from, SectorEntityToken to) {
049                        this.width = width;
050                        this.from = from;
051                        this.to = to;
052                }
053
054                public ArrowData(float width, SectorEntityToken from, SectorEntityToken to, Color color) {
055                        this.width = width;
056                        this.from = from;
057                        this.to = to;
058                        this.color = color;
059                }
060        }
061        
062        public static final float LIST_ITEM_TEXT_WIDTH = 261f;
063        public static final float NEW_DAYS = 5f;
064        
065        /**
066         * Lower-tier shown first.
067         */
068        public static enum IntelSortTier {
069                TIER_0,
070                TIER_1,
071                TIER_2,
072                TIER_3, // default
073                TIER_4,
074                TIER_5,
075                TIER_6,
076                TIER_COMPLETED,
077        }
078        
079        
080        /**
081         * 40x40, no icon if null.
082         * @return
083         */
084        String getIcon();
085        
086        /**
087         * 20x20, if null will use default.
088         * @return
089         */
090        String getImportantIcon();
091        
092        boolean hasImportantButton();
093        boolean canTurnImportantOff();
094        
095        
096        Color getBackgroundGlowColor();
097        
098//      void createIntelListInfo(TooltipMakerAPI info);
099//      void createMessageListInfo(TooltipMakerAPI info);
100        
101        void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode);
102
103        boolean hasSmallDescription();
104        String getSmallDescriptionTitle();
105        void createSmallDescription(TooltipMakerAPI info, float width, float height);
106        
107        boolean hasLargeDescription();
108        void createLargeDescription(CustomPanelAPI panel, float width, float height);
109        
110        void notifyPlayerAboutToOpenIntelScreen();
111        boolean shouldRemoveIntel();
112        
113        /**
114         * Method NEEDS to handle map being null gracefully.
115         * @param map
116         * @return
117         */
118        Set<String> getIntelTags(SectorMapAPI map);
119        boolean isImportant();
120        void setImportant(Boolean important);
121        SectorEntityToken getMapLocation(SectorMapAPI map);
122        
123        List<ArrowData> getArrowData(SectorMapAPI map);
124        
125        
126        boolean doesButtonHaveConfirmDialog(Object buttonId);
127        StoryPointActionDelegate getButtonStoryPointActionDelegate(Object buttonId);
128        float getConfirmationPromptWidth(Object buttonId);
129        void createConfirmationPrompt(Object buttonId, TooltipMakerAPI prompt);
130        String getConfirmText(Object buttonId);
131        String getCancelText(Object buttonId);
132        FactionAPI getFactionForUIColors();
133        
134        void buttonPressConfirmed(Object buttonId, IntelUIAPI ui);
135        void buttonPressCancelled(Object buttonId, IntelUIAPI ui);
136        void storyActionConfirmed(Object buttonId, IntelUIAPI ui);
137        
138        void setPlayerVisibleTimestamp(Long timestamp);
139        Long getPlayerVisibleTimestamp();
140        boolean autoAddCampaignMessage();
141        String getCommMessageSound();
142        
143        /**
144         * Only checked if adding using IntelManager.queueIntel(). addIntel() bypasses this and all other checks.
145         * @param playerInRelayRange
146         * @return
147         */
148        boolean canMakeVisibleToPlayer(boolean playerInRelayRange);
149        void reportMadeVisibleToPlayer();
150        void reportPlayerClickedOn();
151        void reportRemovedIntel();
152        
153        boolean isNew();
154        void setNew(boolean isNew);
155        
156        IntelSortTier getSortTier();
157        String getSortString();
158
159        
160        /**
161         * Whether to actually show this piece of intel in the intel screen/show messages or updates for it,
162         * despite it being technically known to the player. 
163         * 
164         * Something can have "reportMadeVisibleToPlayer" called on it but still be hidden.
165         * 
166         * @return
167         */
168        boolean isHidden();
169        void setHidden(boolean hidden); 
170        
171        /**
172         * Should return 0 if the concept doesn't apply.
173         * @return
174         */
175        float getTimeRemainingFraction();
176
177        
178        Color getCircleBorderColorOverride();
179        
180        boolean forceAddNextFrame();
181        void setForceAddNextFrame(boolean add);
182
183        boolean isEnded();
184
185        boolean isEnding();
186
187
188        void tableRowClicked(IntelUIAPI ui, TableRowClickData data);
189
190        Set<String> getTagsForSort();
191        void setTagsForSort(Set<String> tagsForSort);
192}
193
194
195
196
197