001package com.fs.starfarer.api.impl.campaign.plog;
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.impl.campaign.intel.BaseIntelPlugin;
012import com.fs.starfarer.api.ui.CustomPanelAPI;
013import com.fs.starfarer.api.ui.SectorMapAPI;
014import com.fs.starfarer.api.ui.TooltipMakerAPI;
015import com.fs.starfarer.api.util.Misc;
016
017public class PLIntel extends BaseIntelPlugin {
018        //public static Logger log = Global.getLogger(PLIntel.class);
019        
020        public PLIntel() {
021                //Global.getSector().getIntelManager().addIntel(this);
022        }
023        
024        protected void addBulletPoints(TooltipMakerAPI info, ListInfoMode mode) {
025                
026                Color h = Misc.getHighlightColor();
027                Color g = Misc.getGrayColor();
028                float pad = 3f;
029                float opad = 10f;
030                
031                float initPad = pad;
032                if (mode == ListInfoMode.IN_DESC) initPad = opad;
033                
034                Color tc = getBulletColorForMode(mode);
035                
036                bullet(info);
037                //boolean isUpdate = getListInfoParam() != null;
038                
039//              info.addPara("Factions: ", tc, initPad);
040//              indent(info);
041//              LabelAPI label = info.addPara("%s and %s", 0f, tc,
042//                               h, one.getDisplayName(), two.getDisplayName());
043//              label.setHighlight(one.getDisplayName(), two.getDisplayName());
044//              label.setHighlightColors(one.getBaseUIColor(), two.getBaseUIColor());
045//              
046//              info.addPara(one.getDisplayName(), 0f, tc,
047//                                       one.getBaseUIColor(), one.getDisplayName());
048//              info.addPara(two.getDisplayName(), 0f, tc,
049//                                       two.getBaseUIColor(), two.getDisplayName());
050                        
051                unindent(info);
052        }
053        
054        @Override
055        public void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode) {
056                Color h = Misc.getHighlightColor();
057                Color g = Misc.getGrayColor();
058                Color c = getTitleColor(mode);
059                float pad = 3f;
060                float opad = 10f;
061                
062                info.addPara(getName(), c, 0f);
063                
064                addBulletPoints(info, mode);
065        }
066        
067        public String getSortString() {
068                //return "History";
069                //return "Fleet Log " + getPlayerVisibleTimestamp();
070                return "AAA"; // shows up first in fleet log
071        }
072        
073        public String getName() {
074                if (Misc.isPlayerFactionSetUp()) {
075                        return Global.getSector().getPlayerFaction().getDisplayName() + " - History";
076                }
077                return Global.getSector().getPlayerPerson().getNameString() + " - History";
078                //return "Fleet Log";
079        }
080        
081        @Override
082        public FactionAPI getFactionForUIColors() {
083                return Global.getSector().getPlayerFaction();
084        }
085
086        public String getSmallDescriptionTitle() {
087                return getName();
088        }
089        
090        public void createLargeDescription(CustomPanelAPI panel, float width, float height) {
091                
092                Color h = Misc.getHighlightColor();
093                Color g = Misc.getGrayColor();
094                Color tc = Misc.getTextColor();
095                float pad = 3f;
096                float opad = 10f;
097
098                TooltipMakerAPI info = panel.createUIElement(width, height, false);
099                panel.addUIElement(info).inTL(0, 0);
100                
101                // sorry
102                info.addPlaythroughDataPanel(width, height);
103        }
104        
105        @Override
106        public boolean hasLargeDescription() {
107                return true;
108        }
109
110        @Override
111        public boolean hasSmallDescription() {
112                return false;
113        }
114
115        public String getIcon() {
116                return Global.getSettings().getSpriteName("intel", "playthrough_log");
117        }
118        
119        public Set<String> getIntelTags(SectorMapAPI map) {
120                Set<String> tags = super.getIntelTags(map);
121                tags.add(Tags.INTEL_FLEET_LOG);
122                tags.add(Tags.INTEL_STORY);
123                return tags;
124        }
125
126        @Override
127        public SectorEntityToken getMapLocation(SectorMapAPI map) {
128                return null;
129        }
130
131}
132
133
134