001package com.fs.starfarer.api.impl.campaign.intel.misc;
002
003import java.util.Set;
004
005import java.awt.Color;
006
007import com.fs.starfarer.api.Global;
008import com.fs.starfarer.api.campaign.FactionAPI;
009import com.fs.starfarer.api.campaign.SectorEntityToken;
010import com.fs.starfarer.api.impl.campaign.ids.Tags;
011import com.fs.starfarer.api.ui.SectorMapAPI;
012import com.fs.starfarer.api.ui.TooltipMakerAPI;
013import com.fs.starfarer.api.util.Misc;
014
015public class BreadcrumbIntelV2 extends FleetLogIntel {
016
017        protected SectorEntityToken target;
018        
019        protected String title;
020        protected String text;
021        
022        protected Boolean showSpecificEntity = null;
023        
024        public BreadcrumbIntelV2(SectorEntityToken target) {
025                this.target = target;
026                setRemoveTrigger(target);
027        }
028        
029        @Override
030        public void reportRemovedIntel() {
031                super.reportRemovedIntel();
032        }
033
034        public String getTitle() {
035                return title;
036        }
037
038        public void setTitle(String title) {
039                this.title = title;
040        }
041
042        public String getText() {
043                return text;
044        }
045
046        public void setText(String text) {
047                this.text = text;
048        }
049
050        @Override
051        public void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode) {
052                Color c = getTitleColor(mode);
053                info.addPara(getName(), c, 0f);
054        }
055
056        @Override
057        public void createSmallDescription(TooltipMakerAPI info, float width, float height) {
058                Color h = Misc.getHighlightColor();
059                Color g = Misc.getGrayColor();
060                Color tc = Misc.getTextColor();
061                float pad = 3f;
062                float opad = 10f;
063
064                info.addImage(Global.getSettings().getSpriteName("illustrations", "space_wreckage"), width, opad);
065                
066                info.addPara(text, opad);
067                
068                //target.getOrbit().updateLocation();
069                
070//              float days = getDaysSincePlayerVisible();
071//              if (days >= 1) {
072//                      addDays(info, "ago.", days, tc, opad);
073//              }
074                addLogTimestamp(info, tc, opad);
075                
076//              LuddicPathBaseIntel base = new LuddicPathBaseIntel((StarSystemAPI) Global.getSector().getCurrentLocation(), Factions.LUDDIC_PATH);
077//              Global.getSector().addScript(base);
078//              MemoryAPI mem = base.getEntity().getMemoryWithoutUpdate();
079//              mem.set("$blah", t
080                
081                addDeleteButton(info, width);
082        }
083
084        @Override
085        public String getIcon() {
086                return super.getIcon();
087        }
088
089        @Override
090        public Set<String> getIntelTags(SectorMapAPI map) {
091                Set<String> tags = super.getIntelTags(map);
092                tags.remove(Tags.INTEL_FLEET_LOG);
093                tags.add(Tags.INTEL_EXPLORATION);
094                return tags;
095        }
096
097        public String getSortString() {
098                //return "Location";
099                return super.getSortString();
100        }
101
102        public String getName() {
103                return title;
104        }
105
106        @Override
107        public FactionAPI getFactionForUIColors() {
108                return super.getFactionForUIColors();
109        }
110
111        public String getSmallDescriptionTitle() {
112                return getName();
113        }
114
115        @Override
116        public SectorEntityToken getMapLocation(SectorMapAPI map) {
117                if (target.getStarSystem() != null && showSpecificEntity == null) {
118                        return target.getStarSystem().createToken(0, 0);
119                        //return target.getStarSystem().getCenter();
120                }
121                return target;
122        }
123
124        @Override
125        public boolean shouldRemoveIntel() {
126                return super.shouldRemoveIntel();
127        }
128
129        @Override
130        public String getCommMessageSound() {
131                if (sound != null) return sound;
132                return getSoundMinorMessage();
133        }
134        
135        public Boolean getShowSpecificEntity() {
136                return showSpecificEntity;
137        }
138
139        public void setShowSpecificEntity(Boolean showPlanet) {
140                if (showPlanet != null && !showPlanet) showPlanet = null;
141                
142                this.showSpecificEntity = showPlanet;
143        }
144
145}