Package gg.xp.xivsupport.timelines
Interface TimelineEntry
- All Superinterfaces:
Comparable<TimelineEntry>
- All Known Subinterfaces:
CustomTimelineItem
- All Known Implementing Classes:
CustomTimelineEntry
,CustomTimelineLabel
,TextFileLabelEntry
,TextFileTimelineEntry
,TranslatedTextFileEntry
Base interface for a timeline entry
-
Method Summary
Modifier and TypeMethodDescriptionboolean
callout()
double
default boolean
canSync()
default int
compareTo
(@NotNull TimelineEntry o) Compare the times of this timeline entry vs another entry@Nullable Double
duration()
An optional duration for the bar to be in "active" state as opposed to immediately becoming "in the past" when its time arrives.default double
boolean
enabled()
default boolean
enabledForJob
(Job job) Whether the entry is enabled for a certain job@Nullable EventSyncController
default boolean
Affects the behavior ofjump()
andjumpLabel()
.default @Nullable String
default double
default double
default Double
getSyncToTime
(LabelResolver resolver) default boolean
default @Nullable URL
icon()
default boolean
default boolean
isLabel()
@Nullable Double
jump()
An optional time to jump to.@Nullable String
Same asjump()
, but takes a 'label' to jump to instead of a raw time.default @Nullable String
@Nullable String
name()
The name of this timeline entry.default @Nullable TimelineReference
replaces()
default boolean
shouldSupersede
(TimelineEntry that) Determine if another timeline entry should be replaced by this one.default boolean
shouldSync
(double currentTime, Event event) default boolean
shouldSync
(double currentTime, String line) Determine whether the timeline should be synced to this entry given the current time and a line@Nullable Pattern
sync()
ACT parsed line regex to sync todouble
time()
The time of this timeline entry@NotNull TimelineWindow
The relative window in which this entry can be synced to@Nullable String
toString()
default String
default TimelineEntry
The untranslated version of this entry.
-
Method Details
-
getMinTime
default double getMinTime()- Returns:
- The earliest possible sync time
-
getMaxTime
default double getMaxTime()- Returns:
- The latest possible sync time
-
shouldSync
Determine whether the timeline should be synced to this entry given the current time and a line- Parameters:
currentTime
- The time at which the timeline currently sitsline
- The incoming log line- Returns:
- Whether the timeline should sync
-
eventSyncController
-
hasEventSync
default boolean hasEventSync() -
eventSyncType
-
shouldSync
-
canSync
default boolean canSync()- Returns:
- true if this timeline entry would ever cause a sync
-
getSyncToTime
- Returns:
- The time to sync to, or null in the case of a resolution error (error should be logged elsewhere)
-
toString
-
time
double time()The time of this timeline entry- Returns:
- The timeline entry's time
-
name
The name of this timeline entry.For most entries, this is the displayed name. For labels, it is the label name. For triggers, it is the text that will be displayed on-screen.
- Returns:
- The name
-
sync
ACT parsed line regex to sync to- Returns:
- The sync pattern
-
duration
An optional duration for the bar to be in "active" state as opposed to immediately becoming "in the past" when its time arrives.- Returns:
- The optional duration
-
timelineWindow
The relative window in which this entry can be synced to- Returns:
- The sync window
-
jump
An optional time to jump to. IfforceJump()
is false, this line must have its sync conditions hit (i.e. we are syncing onto this line). If forceJump is true, then the jump will also happen if this timeline entry's time is hit.- Returns:
- The jump time.
- See Also:
-
jumpLabel
Same asjump()
, but takes a 'label' to jump to instead of a raw time.- Returns:
- The jump label
- See Also:
-
forceJump
default boolean forceJump()Affects the behavior ofjump()
andjumpLabel()
. If true, then the jump will occur unconditionally when the current timeline time hits the time of this entry (i.e. when we are T-0 from hitting this entry). If false, jumps will only occur when this entry is synced to.- Returns:
- whether to force jumps even without a sync
- See Also:
-
isLabel
default boolean isLabel()- Returns:
- true if this entry is a label
-
enabled
boolean enabled()- Returns:
- Whether this entry is enabled
-
compareTo
Compare the times of this timeline entry vs another entry- Specified by:
compareTo
in interfaceComparable<TimelineEntry>
- Parameters:
o
- the timeline entry to which we are comparing- Returns:
- The same as
Double.compare(this.time(), o.time())
-
icon
- Returns:
- An optional icon to display for the entry on the timeline bar and trigger (if it has one)
-
replaces
- Returns:
- If this entry overrides another entry, return a reference to the entry it overrides. Otherwise, return null.
- See Also:
-
shouldSupersede
Determine if another timeline entry should be replaced by this one. Always returns null ifreplaces()
is null.- Parameters:
that
- The entry to check if we are replacing.- Returns:
- true if it should be superseded/replaced by this entry, false otherwise.
-
callout
boolean callout()- Returns:
- True if this entry is also a timeline trigger.
-
calloutPreTime
double calloutPreTime()- Returns:
- The amount of time before this entry's
time()
that the trigger should fire
-
effectiveCalloutTime
default double effectiveCalloutTime()- Returns:
- The effective time at which the trigger would fire
-
enabledForJob
Whether the entry is enabled for a certain job- Parameters:
job
- The job- Returns:
- true if enabled for that job
-
untranslated
The untranslated version of this entry.- Returns:
- The untranslated version. Returns 'this' if it is already untranslated.
-
toTextFormat
- Returns:
- This entry, ported back to Cactbot format.
-
makeTriggerTimelineEntries
- Returns:
- Any extra Cactbot-format timeline entries needed to make this work as a trigger. Does not include the actual user-js trigger, only the timeline entries that will be necessary for it.
-
getAllTextEntries
- Returns:
- A stream consisting of
toTextFormat()
andmakeTriggerTimelineEntries()
-
makeTriggerJs
- Returns:
- The Cactbot user-js needed to make this timeline trigger work. If this is not a trigger, return null;
-
getImportSource
-
isImported
default boolean isImported()
-