001package com.fs.starfarer.api.impl.campaign.missions.hub;
002
003import java.awt.Color;
004import java.util.ArrayList;
005import java.util.LinkedHashSet;
006import java.util.List;
007import java.util.Set;
008
009import com.fs.starfarer.api.Global;
010import com.fs.starfarer.api.campaign.FactionAPI;
011import com.fs.starfarer.api.campaign.SectorEntityToken;
012import com.fs.starfarer.api.impl.campaign.ids.Tags;
013import com.fs.starfarer.api.impl.campaign.intel.BaseIntelPlugin;
014import com.fs.starfarer.api.ui.SectorMapAPI;
015import com.fs.starfarer.api.ui.TooltipMakerAPI;
016import com.fs.starfarer.api.util.Misc;
017
018public class IntelMarkerIntel extends BaseIntelPlugin {
019        
020        protected SectorEntityToken loc;
021        protected String title;
022        protected String icon;
023        protected String text;
024        protected LinkedHashSet<String> tags = new LinkedHashSet<String>();
025        protected FactionAPI faction;
026
027        public IntelMarkerIntel(FactionAPI faction, SectorEntityToken loc,
028                        String icon, String title, String text,
029                        Set<String> tags) {
030                this.faction = faction;
031                this.loc = loc;
032                this.icon = icon;
033                this.title = title;
034                this.text = text;
035                this.tags.addAll(tags);
036        }
037
038//      @Override
039//      public void advance(float amount) {
040//              super.advance(amount);
041//              if (!isEnded() && !Global.getSector().isPaused()) {
042//                      endImmediately();
043//              }
044//      }
045
046        @Override
047        public void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode) {
048                Color h = Misc.getHighlightColor();
049                Color g = Misc.getGrayColor();
050                Color c = getTitleColor(mode);
051                float pad = 3f;
052                float opad = 10f;
053                
054                c = Misc.getHighlightColor();
055                
056                info.addPara(title, c, 0f);
057                
058//              if (subtitle != null) {
059//                      float initPad = pad;
060//                      bullet(info);
061//                      //info.addPara(subtitle, c, initPad);
062//                      info.addPara(subtitle, g, initPad);
063//                      unindent(info);
064//              }
065        }
066
067        public String getSortString() {
068                return title;
069        }
070        
071        @Override
072        public IntelSortTier getSortTier() {
073                return IntelSortTier.TIER_0;
074        }
075
076        public String getName() {
077                return title;
078        }
079        
080        public String getSmallDescriptionTitle() {
081                return getName();
082        }
083        
084        public void createSmallDescription(TooltipMakerAPI info, float width, float height) {
085                
086                Color h = Misc.getHighlightColor();
087                Color g = Misc.getGrayColor();
088                Color tc = Misc.getTextColor();
089                float pad = 3f;
090                float opad = 10f;
091
092//              if (image != null) {
093//                      info.addImage(image, width, 128, opad);
094//              }
095                if (text != null && !text.isEmpty()) {
096                        info.addPara(text, tc, opad);
097                }
098        }
099        
100        @Override
101        public FactionAPI getFactionForUIColors() {
102                //return faction;
103                return super.getFactionForUIColors();
104        }
105
106        public String getIcon() {
107                return icon;
108        }
109        
110        public Set<String> getIntelTags(SectorMapAPI map) {
111                //Set<String> tags = super.getIntelTags(map);
112                Set<String> tags = new LinkedHashSet<String>(this.tags);
113                //tags.add(Tags.INTEL_MISSIONS);
114                tags.add(Tags.INTEL_NEW);
115                return tags;
116        }
117
118        @Override
119        public SectorEntityToken getMapLocation(SectorMapAPI map) {
120                return loc;
121        }
122
123        @Override
124        public List<ArrowData> getArrowData(SectorMapAPI map) {
125                //return super.getArrowData(map);
126                List<ArrowData> result = new ArrayList<ArrowData>();
127                ArrowData d = new ArrowData(Global.getSector().getPlayerFleet(), loc);
128                result.add(d);
129                return result;
130        }
131        
132        public Color getCircleBorderColorOverride() {
133                return Misc.getHighlightColor();
134        }
135        
136}
137
138