001package com.fs.starfarer.api.impl.codex; 002 003import java.util.List; 004import java.util.Set; 005 006import java.awt.Color; 007 008import com.fs.starfarer.api.ModSpecAPI; 009import com.fs.starfarer.api.campaign.CustomUIPanelPlugin; 010import com.fs.starfarer.api.ui.CustomPanelAPI; 011import com.fs.starfarer.api.ui.TagDisplayAPI; 012import com.fs.starfarer.api.ui.TooltipMakerAPI; 013import com.fs.starfarer.api.ui.UIPanelAPI; 014 015public interface CodexEntryPlugin { 016 017 public static enum ListMode { 018 ITEM_LIST, 019 RELATED_ENTRIES, 020 } 021 022 023 public void createTitleForList(TooltipMakerAPI info, float width, ListMode mode); 024 025 026 public String getId(); 027 public String getTitle(); 028 public String getSortTitle(); 029 public String getSearchString(); 030 public String getIcon(); 031 public boolean isVignetteIcon(); 032 default Color getIconColor() { 033 return Color.white; 034 } 035 036 public CodexEntryPlugin getParent(); 037 public void setParent(CodexEntryPlugin parent); 038 039 040 041 public boolean isRetainOrderOfChildren(); 042 public void setRetainOrderOfChildren(boolean retainOrderOfChildren); 043 public List<CodexEntryPlugin> getChildren(); 044 public void addChild(CodexEntryPlugin entry); 045 046 public boolean isCategory(); 047 public boolean hasDetail(); 048 049 public boolean isVisible(); 050 public Object getParam(); 051 public Object getParam2(); 052 053 public boolean isLocked(); 054 055 056 boolean matchesTags(Set<String> tags); 057 boolean hasTagDisplay(); 058 public void configureTagDisplay(TagDisplayAPI tags); 059 060 public Set<CodexEntryPlugin> getRelatedEntries(); 061 public void addRelatedEntry(CodexEntryPlugin entry); 062 public void addRelatedEntry(String id); 063 public void removeRelatedEntry(CodexEntryPlugin entry); 064 public void removeRelatedEntry(String id); 065 public boolean isRetainOrderOfRelatedEntries(); 066 public void setRetainOrderOfRelatedEntries(boolean retainOrderOfRelatedEntries); 067 068 /** 069 * Checked for the *parent* of the related entry. 070 * @return 071 */ 072 public float getCategorySortTierForRelatedEntries(); 073 public void setCategorySortTierForRelatedEntries(float categorySortTierForRelatedEntries); 074 075 076 List<CodexEntryPlugin> getChildrenRecursive(boolean includeCategories); 077 078 079 boolean hasCustomDetailPanel(); 080 081 /** 082 * Optional, can be null. 083 * @return 084 */ 085 CustomUIPanelPlugin getCustomPanelPlugin(); 086 void createCustomDetail(CustomPanelAPI panel, UIPanelAPI relatedEntries, CodexDialogAPI codex); 087 void destroyCustomDetail(); 088 089 090 Set<String> getRelatedEntryIds(); 091 092 093 boolean skipForTags(); 094 095 096 /** 097 * These tags are completely unrelated to the matchesTags() method; these are not player-facing at all. 098 * @return 099 */ 100 Set<String> getTags(); 101 /** 102 * These tags are completely unrelated to the matchesTags() method; these are not player-facing at all. 103 * @return 104 */ 105 void addTag(String tag); 106 /** 107 * These tags are completely unrelated to the matchesTags() method; these are not player-facing at all. 108 * @return 109 */ 110 boolean hasTag(String tag); 111 void setIcon(String icon); 112 boolean checkTagsWhenLocked(); 113 ModSpecAPI getSourceMod(); 114 115} 116 117 118 119 120 121 122 123