Class BaseIntelPlugin
java.lang.Object
com.fs.starfarer.api.impl.campaign.intel.BaseIntelPlugin
- All Implemented Interfaces:
IntelInfoPlugin
,EveryFrameScript
,CommRelayEntityPlugin.CommSnifferReadableIntel
,CallEvent.CallableEvent
- Direct Known Subclasses:
BaseBarEventIntel
,BaseEventIntel
,BaseHistorianOffer
,BaseHubMission
,BaseMissionIntel
,CommSnifferIntel
,ContactIntel
,DecivIntel
,FactionHostilityIntel
,FleetGroupIntel
,FleetLogIntel
,GateHaulerIntel
,GateIntel
,GensHannanMachinations
,IntelMarkerIntel
,LuddicChurchImmigrationDeal
,LuddicPathBaseIntel
,LuddicPathCellsIntel
,LuddicShrineIntel
,MessageIntel
,NewMessagesIntel
,PerseanLeagueMembership
,PersonBountyIntel
,PirateActivityIntel
,PirateBaseIntel
,PlanetaryShieldIntel
,PLIntel
,PromoteOfficerIntel
,RaidIntel
,SalvorsTallyIntel
,ScientistAICoreIntel
,SindrianDiktatFuelDeal
,SystemBountyIntel
,TradeFleetDepartureIntel
,TriTachLoanIntel
,TriTachyonDeal
,TutorialMissionIntel
,WarningBeaconIntel
public class BaseIntelPlugin
extends Object
implements IntelInfoPlugin, CallEvent.CallableEvent, EveryFrameScript, CommRelayEntityPlugin.CommSnifferReadableIntel
- Author:
- Alex Mosolov Copyright 2018 Fractal Softworks, LLC
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.fs.starfarer.api.campaign.comm.IntelInfoPlugin
IntelInfoPlugin.ArrowData, IntelInfoPlugin.IntelSortTier, IntelInfoPlugin.ListInfoMode, IntelInfoPlugin.TableRowClickData
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static String
protected Boolean
protected Boolean
protected Float
protected Boolean
protected Boolean
protected Boolean
static final String
protected Object
protected Boolean
protected SectorEntityToken
protected Float
protected Long
Fields inherited from interface com.fs.starfarer.api.campaign.comm.IntelInfoPlugin
LIST_ITEM_TEXT_WIDTH, NEW_DAYS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
addBulletPoints
(TooltipMakerAPI info, IntelInfoPlugin.ListInfoMode mode, boolean isUpdate, Color tc, float initPad) protected void
addDays
(TooltipMakerAPI info, String after, float days) protected void
addDays
(TooltipMakerAPI info, String after, float days, Color c) protected void
addDays
(TooltipMakerAPI info, String after, float days, Color c, float pad) protected void
addDays
(TooltipMakerAPI info, String before, String after, float days, Color c, float pad) protected void
addDeleteButton
(TooltipMakerAPI info, float width) protected void
addDeleteButton
(TooltipMakerAPI info, float width, String delete) addGenericButton
(TooltipMakerAPI info, float width, Color tc, Color bg, String text, Object data) addGenericButton
(TooltipMakerAPI info, float width, String text, Object data) void
addLogTimestamp
(TooltipMakerAPI info, Color tc, float opad) static void
addMarketTable
(TooltipMakerAPI info, Color base, Color dark, Color bright, List<MarketAPI> markets, float width, float pad) static void
addMarketToList
(TooltipMakerAPI info, MarketAPI market, float pad) static void
addMarketToList
(TooltipMakerAPI info, MarketAPI market, float pad, Color tc) void
advance
(float amount) Use SectorAPI.getClock() to convert to campaign days.protected void
advanceImpl
(float amount) boolean
protected void
bullet
(TooltipMakerAPI info) void
buttonPressCancelled
(Object buttonId, IntelUIAPI ui) void
buttonPressConfirmed
(Object buttonId, IntelUIAPI ui) boolean
callEvent
(String ruleId, InteractionDialogAPI dialog, List<Misc.Token> params, Map<String, MemoryAPI> memoryMap) boolean
canMakeVisible
(boolean playerInRelayRange, LocationAPI conLoc, org.lwjgl.util.vector.Vector2f hyperLoc, boolean commSniffer) boolean
canMakeVisibleToCommSniffer
(boolean playerInRelayRange, SectorEntityToken relay) boolean
canMakeVisibleToPlayer
(boolean playerInRelayRange) Only checked if adding using IntelManager.queueIntel().boolean
void
createConfirmationPrompt
(Object buttonId, TooltipMakerAPI prompt) protected void
void
void
createLargeDescription
(CustomPanelAPI panel, float width, float height) void
createSmallDescription
(TooltipMakerAPI info, float width, float height) boolean
doesButtonHaveConfirmDialog
(Object buttonId) void
void
endAfterDelay
(float days) void
boolean
getArrowData
(SectorMapAPI map) protected float
protected Color
getButtonStoryPointActionDelegate
(Object buttonId) getCancelText
(Object buttonId) protected float
float
getConfirmationPromptWidth
(Object buttonId) getConfirmText
(Object buttonId) protected String
getDays
(float days) float
static String
getDaysString
(float days) getIcon()
40x40, no icon if null.20x20, if null will use default.getIntelTags
(SectorMapAPI map) Method NEEDS to handle map being null gracefully.Call from createMessageListInfo() to figure out what type of update to create.protected String
getName()
getSortStringNewestFirst
(String prefix) static String
static String
static String
static String
static String
static String
float
Should return 0 if the concept doesn't apply.boolean
boolean
boolean
protected void
indent
(TooltipMakerAPI info) boolean
isDone()
boolean
isEnded()
boolean
isEnding()
boolean
isHidden()
Whether to actually show this piece of intel in the intel screen/show messages or updates for it, despite it being technically known to the player.boolean
boolean
isNew()
boolean
boolean
protected void
protected void
void
void
void
void
boolean
void
sendUpdate
(Object listInfoParam, TextPanelAPI textPanel) void
sendUpdateIfPlayerHasIntel
(Object listInfoParam, boolean onlyIfImportant) void
sendUpdateIfPlayerHasIntel
(Object listInfoParam, boolean onlyIfImportant, boolean sendIfHidden) void
sendUpdateIfPlayerHasIntel
(Object listInfoParam, TextPanelAPI textPanel) void
setForceAddNextFrame
(boolean add) void
setHidden
(boolean hidden) void
setImportant
(Boolean important) void
setListInfoParam
(Object listInfoParam) void
setNew
(boolean isNew) void
setPlayerVisibleTimestamp
(Long timestamp) void
setPostingLocation
(SectorEntityToken postingLocation) void
setPostingRangeLY
(Float postingRangeLY) void
setPostingRangeLY
(Float postingRangeLY, boolean ensureVisibleOutsideSystem) void
setTagsForSort
(Set<String> tagsForSort) boolean
void
storyActionConfirmed
(Object buttonId, IntelUIAPI ui) void
protected void
unindent
(TooltipMakerAPI info)
-
Field Details
-
BULLET
- See Also:
-
INDENT
- See Also:
-
BUTTON_DELETE
-
important
-
timestamp
-
neverClicked
-
listInfoParam
-
ended
-
ending
-
endingTimeRemaining
-
postingLocation
-
postingRangeLY
-
tagsForSort
-
forceAdd
-
-
Constructor Details
-
BaseIntelPlugin
public BaseIntelPlugin()
-
-
Method Details
-
advance
public void advance(float amount) Description copied from interface:EveryFrameScript
Use SectorAPI.getClock() to convert to campaign days.- Specified by:
advance
in interfaceEveryFrameScript
- Parameters:
amount
- seconds elapsed during the last frame.
-
notifyPlayerAboutToOpenIntelScreen
public void notifyPlayerAboutToOpenIntelScreen()- Specified by:
notifyPlayerAboutToOpenIntelScreen
in interfaceIntelInfoPlugin
-
advanceImpl
protected void advanceImpl(float amount) -
notifyEnding
protected void notifyEnding() -
notifyEnded
protected void notifyEnded() -
endImmediately
public void endImmediately() -
endAfterDelay
public void endAfterDelay() -
endAfterDelay
public void endAfterDelay(float days) -
getBaseDaysAfterEnd
protected float getBaseDaysAfterEnd() -
isDone
public boolean isDone()- Specified by:
isDone
in interfaceEveryFrameScript
- Returns:
- true when the script is finished and can be cleaned up by the engine.
-
runWhilePaused
public boolean runWhilePaused()- Specified by:
runWhilePaused
in interfaceEveryFrameScript
- Returns:
- whether advance() should be called while the campaign engine is paused.
-
isEnding
public boolean isEnding()- Specified by:
isEnding
in interfaceIntelInfoPlugin
-
isEnded
public boolean isEnded()- Specified by:
isEnded
in interfaceIntelInfoPlugin
-
getListInfoParam
Call from createMessageListInfo() to figure out what type of update to create. Call from getCommMesageSound() to pick sound to play.- Returns:
-
setListInfoParam
-
isSendingUpdate
public boolean isSendingUpdate() -
sendUpdate
-
sendUpdateIfPlayerHasIntel
-
sendUpdateIfPlayerHasIntel
-
sendUpdateIfPlayerHasIntel
public void sendUpdateIfPlayerHasIntel(Object listInfoParam, boolean onlyIfImportant, boolean sendIfHidden) -
canTurnImportantOff
public boolean canTurnImportantOff()- Specified by:
canTurnImportantOff
in interfaceIntelInfoPlugin
-
getImportantIcon
Description copied from interface:IntelInfoPlugin
20x20, if null will use default.- Specified by:
getImportantIcon
in interfaceIntelInfoPlugin
- Returns:
-
hasImportantButton
public boolean hasImportantButton()- Specified by:
hasImportantButton
in interfaceIntelInfoPlugin
-
addBulletPoints
-
addBulletPoints
protected void addBulletPoints(TooltipMakerAPI info, IntelInfoPlugin.ListInfoMode mode, boolean isUpdate, Color tc, float initPad) -
createIntelInfo
- Specified by:
createIntelInfo
in interfaceIntelInfoPlugin
-
getName
-
hasSmallDescription
public boolean hasSmallDescription()- Specified by:
hasSmallDescription
in interfaceIntelInfoPlugin
-
createSmallDescription
- Specified by:
createSmallDescription
in interfaceIntelInfoPlugin
-
hasLargeDescription
public boolean hasLargeDescription()- Specified by:
hasLargeDescription
in interfaceIntelInfoPlugin
-
createLargeDescription
- Specified by:
createLargeDescription
in interfaceIntelInfoPlugin
-
getIcon
Description copied from interface:IntelInfoPlugin
40x40, no icon if null.- Specified by:
getIcon
in interfaceIntelInfoPlugin
- Returns:
-
getBackgroundGlowColor
- Specified by:
getBackgroundGlowColor
in interfaceIntelInfoPlugin
-
shouldRemoveIntel
public boolean shouldRemoveIntel()- Specified by:
shouldRemoveIntel
in interfaceIntelInfoPlugin
-
getIntelTags
Description copied from interface:IntelInfoPlugin
Method NEEDS to handle map being null gracefully.- Specified by:
getIntelTags
in interfaceIntelInfoPlugin
- Returns:
-
isImportant
public boolean isImportant()- Specified by:
isImportant
in interfaceIntelInfoPlugin
-
setImportant
- Specified by:
setImportant
in interfaceIntelInfoPlugin
-
getFactionForUIColors
- Specified by:
getFactionForUIColors
in interfaceIntelInfoPlugin
-
doesButtonHaveConfirmDialog
- Specified by:
doesButtonHaveConfirmDialog
in interfaceIntelInfoPlugin
-
getConfirmationPromptWidth
- Specified by:
getConfirmationPromptWidth
in interfaceIntelInfoPlugin
-
createDeleteConfirmationPrompt
-
createConfirmationPrompt
- Specified by:
createConfirmationPrompt
in interfaceIntelInfoPlugin
-
getConfirmText
- Specified by:
getConfirmText
in interfaceIntelInfoPlugin
-
getCancelText
- Specified by:
getCancelText
in interfaceIntelInfoPlugin
-
addDeleteButton
-
addDeleteButton
-
buttonPressConfirmed
- Specified by:
buttonPressConfirmed
in interfaceIntelInfoPlugin
-
buttonPressCancelled
- Specified by:
buttonPressCancelled
in interfaceIntelInfoPlugin
-
isPlayerVisible
public boolean isPlayerVisible() -
getPlayerVisibleTimestamp
- Specified by:
getPlayerVisibleTimestamp
in interfaceIntelInfoPlugin
-
setPlayerVisibleTimestamp
- Specified by:
setPlayerVisibleTimestamp
in interfaceIntelInfoPlugin
-
getDaysSincePlayerVisible
public float getDaysSincePlayerVisible() -
reportPlayerClickedOn
public void reportPlayerClickedOn()- Specified by:
reportPlayerClickedOn
in interfaceIntelInfoPlugin
-
isNew
public boolean isNew()- Specified by:
isNew
in interfaceIntelInfoPlugin
-
setNew
public void setNew(boolean isNew) - Specified by:
setNew
in interfaceIntelInfoPlugin
-
getSortTier
- Specified by:
getSortTier
in interfaceIntelInfoPlugin
-
getSortString
- Specified by:
getSortString
in interfaceIntelInfoPlugin
-
autoAddCampaignMessage
public boolean autoAddCampaignMessage()- Specified by:
autoAddCampaignMessage
in interfaceIntelInfoPlugin
-
getCommMessageSound
- Specified by:
getCommMessageSound
in interfaceIntelInfoPlugin
-
isHidden
public boolean isHidden()Description copied from interface:IntelInfoPlugin
Whether to actually show this piece of intel in the intel screen/show messages or updates for it, despite it being technically known to the player. Something can have "reportMadeVisibleToPlayer" called on it but still be hidden.- Specified by:
isHidden
in interfaceIntelInfoPlugin
- Returns:
-
setHidden
public void setHidden(boolean hidden) - Specified by:
setHidden
in interfaceIntelInfoPlugin
-
reportMadeVisibleToPlayer
public void reportMadeVisibleToPlayer()- Specified by:
reportMadeVisibleToPlayer
in interfaceIntelInfoPlugin
-
getCommRelayRange
protected float getCommRelayRange() -
canMakeVisibleToPlayer
public boolean canMakeVisibleToPlayer(boolean playerInRelayRange) Description copied from interface:IntelInfoPlugin
Only checked if adding using IntelManager.queueIntel(). addIntel() bypasses this and all other checks.- Specified by:
canMakeVisibleToPlayer
in interfaceIntelInfoPlugin
- Returns:
-
canMakeVisibleToCommSniffer
- Specified by:
canMakeVisibleToCommSniffer
in interfaceCommRelayEntityPlugin.CommSnifferReadableIntel
-
canMakeVisible
public boolean canMakeVisible(boolean playerInRelayRange, LocationAPI conLoc, org.lwjgl.util.vector.Vector2f hyperLoc, boolean commSniffer) -
getPostingLocation
-
setPostingLocation
-
getPostingRangeLY
-
setPostingRangeLY
-
setPostingRangeLY
-
reportRemovedIntel
public void reportRemovedIntel()- Specified by:
reportRemovedIntel
in interfaceIntelInfoPlugin
-
getMapLocation
- Specified by:
getMapLocation
in interfaceIntelInfoPlugin
-
bullet
-
indent
-
unindent
-
addDays
-
addDays
-
addDays
-
addDays
protected void addDays(TooltipMakerAPI info, String before, String after, float days, Color c, float pad) -
getDays
-
getDaysString
-
getSmallDescriptionTitle
- Specified by:
getSmallDescriptionTitle
in interfaceIntelInfoPlugin
-
getTitleColor
-
getBulletColorForMode
-
callEvent
public boolean callEvent(String ruleId, InteractionDialogAPI dialog, List<Misc.Token> params, Map<String, MemoryAPI> memoryMap) - Specified by:
callEvent
in interfaceCallEvent.CallableEvent
-
getSoundStandardPosting
-
getSoundStandardUpdate
-
getSoundMajorPosting
-
getSoundColonyThreat
-
getSoundLogUpdate
-
getSoundMinorMessage
-
getArrowData
- Specified by:
getArrowData
in interfaceIntelInfoPlugin
-
getTimeRemainingFraction
public float getTimeRemainingFraction()Description copied from interface:IntelInfoPlugin
Should return 0 if the concept doesn't apply.- Specified by:
getTimeRemainingFraction
in interfaceIntelInfoPlugin
- Returns:
-
addGenericButton
-
addGenericButton
-
forceAddNextFrame
public boolean forceAddNextFrame()- Specified by:
forceAddNextFrame
in interfaceIntelInfoPlugin
-
setForceAddNextFrame
public void setForceAddNextFrame(boolean add) - Specified by:
setForceAddNextFrame
in interfaceIntelInfoPlugin
-
addMarketToList
-
addMarketToList
-
addMarketTable
-
getButtonStoryPointActionDelegate
- Specified by:
getButtonStoryPointActionDelegate
in interfaceIntelInfoPlugin
-
storyActionConfirmed
- Specified by:
storyActionConfirmed
in interfaceIntelInfoPlugin
-
getCircleBorderColorOverride
- Specified by:
getCircleBorderColorOverride
in interfaceIntelInfoPlugin
-
tableRowClicked
- Specified by:
tableRowClicked
in interfaceIntelInfoPlugin
-
addLogTimestamp
-
getSortStringNewestFirst
-
getSortStringNewestFirst
-
getTagsForSort
- Specified by:
getTagsForSort
in interfaceIntelInfoPlugin
-
setTagsForSort
- Specified by:
setTagsForSort
in interfaceIntelInfoPlugin
-