Package gg.xp.xivsupport.callouts
Class ModifiableCallout<X>
java.lang.Object
gg.xp.xivsupport.callouts.ModifiableCallout<X>
- Type Parameters:
X
- The type of event the callout handles. If the callout is typically called without an event, just define the field asModifiableCallout<?>
.
A callout that can be customized by the user on the UI. By default, there will be
TTS and on-screen-text, as well as optional graphics. The user can modify the tts and text,
independently, and change the color of the on-screen text.
Due to evolution of this class over time, some properties are defined in the constructors, while others are set via a builder pattern. In addition, there are some static methods for common patterns.
-
Constructor Summary
ConstructorDescriptionModifiableCallout
(String descriptionAndText) Simple callout with the same description and textModifiableCallout
(String description, String text) The most basic type of callout.ModifiableCallout
(String description, String ttsAndText, int msExpiry) A callout with the same TTS and on-screen text, and a custom expiry time.ModifiableCallout
(String description, String tts, String text) A callout with (optionally) different TTS and on-screen text, and a custom expiry condition. -
Method Summary
Modifier and TypeMethodDescriptionabilityIcon
(long abilityId) Adds a specific ability icon to a callout.void
attachHandle
(ModifiedCalloutHandle handle) Should not be called by a trigger developer.autoIcon()
Adds an automatic icon to a callout.Indicates that this should be disabled by default.static <Y extends HasDuration>
ModifiableCallout<Y>durationBasedCall
(String descAndText) static <Y extends HasDuration>
ModifiableCallout<Y>durationBasedCall
(String desc, String text) Used for things like water stack in TEA or P2S where the callout is based on a buff time or castbar.static <Y extends HasDuration>
ModifiableCallout<Y>durationBasedCallWithOffset
(String desc, String text, Duration offset) static <Y extends HasDuration>
ModifiableCallout<Y>durationBasedCallWithoutDurationText
(String desc, String text) static <Y extends HasDuration>
Predicate<Y>static <Y extends HasDuration>
Predicate<Y>static <Y extends HasDuration>
Predicate<Y>durationExpiryPlusLingerTime
(Duration linger) static <X> Predicate<X>
expiresIn
(int seconds) LikeexpiresIn(Duration)
but takes a number of seconds rather than a Durationstatic <X> Predicate<X>
Read-made predicates for expiration based on time since the event occurredextendedDescription
(String extendedDescription) Adds an extended description.@Nullable String
Generate a real callout event based on this callout's settings, without any event or parameters.getModified
(Map<String, Object> rawArguments) Generate a real callout event based on this callout's settings, without an event to base it on, but with additional variables.getModified
(X event) Generate a real callout event based on this callout's settings, with an event to base it on.getModified
(X event, Map<String, Object> rawArguments) Generate a real callout event based on this callout's settings, with an event to base it on, plus additional variables.guiProvider
(Function<? super X, ? extends Component> guiProvider) Adds a custom graphical component to a calloutboolean
statusIcon
(long statusId) Adds a specific status icon to a callout.statusIcon
(long statusId, long stacks) Adds a specific status icon to a callout.
-
Constructor Details
-
ModifiableCallout
The most basic type of callout. Uses the same text for TTS and on-screen. The on-screen text will appear for the default time (5 seconds)- Parameters:
description
- A description for the callout to be shown to the user.text
- The default TTS and on-screen text.
-
ModifiableCallout
Simple callout with the same description and text- Parameters:
descriptionAndText
- The callout text and description
-
ModifiableCallout
A callout with (optionally) different TTS and on-screen text, and a custom expiry condition. This callout will appear until the 'expiry' predicate returns true.- Parameters:
description
- A description for the callout to be shown to the user.tts
- The default TTStext
- The default on-screen textexpiry
- A condition for expiring the callout (removes it from the on-screen display)
-
ModifiableCallout
A callout with the same TTS and on-screen text, and a custom expiry time.- Parameters:
description
- A description for the callout to be shown to the user.ttsAndText
- The default TTS and text.msExpiry
- The time for the callout to be displayed on the screen.
-
ModifiableCallout
-
-
Method Details
-
expiresIn
Read-made predicates for expiration based on time since the event occurred- Type Parameters:
X
- The event type- Parameters:
dur
- The duration- Returns:
- The predicate
-
autoIcon
Adds an automatic icon to a callout. This expects the event type to be aHasAbility
orHasStatusEffect
- Returns:
- this (builder pattern)
-
statusIcon
Adds a specific status icon to a callout.- Parameters:
statusId
- The status effect ID- Returns:
- this (builder pattern)
-
statusIcon
Adds a specific status icon to a callout.- Parameters:
statusId
- The status effect IDstacks
- The stack count to use for the icon- Returns:
- this (builder pattern)
-
abilityIcon
Adds a specific ability icon to a callout.- Parameters:
abilityId
- The ability ID- Returns:
- this (builder pattern)
-
guiProvider
Adds a custom graphical component to a callout- Parameters:
guiProvider
- A function to turn an event into an AWT component- Returns:
- this (builder pattern)
-
disabledByDefault
Indicates that this should be disabled by default. The user will need to manually turn this on.- Returns:
- this (builder pattern)
-
extendedDescription
Adds an extended description.- Parameters:
extendedDescription
- The extended description- Returns:
- this (builder pattern)
-
expiresIn
LikeexpiresIn(Duration)
but takes a number of seconds rather than a Duration- Type Parameters:
X
- the event type- Parameters:
seconds
- Duration in seconds- Returns:
- the predicate
-
attachHandle
Should not be called by a trigger developer. This is used to attach customizations, since this object will not have access to them initially.- Parameters:
handle
- The ModifiedCalloutHandle
-
getDescription
- Returns:
- The description for the callout
-
getOriginalTts
- Returns:
- The default TTS
-
getOriginalVisualText
- Returns:
- The default on-screen-text
-
getModified
Generate a real callout event based on this callout's settings, without any event or parameters.- Returns:
- A CalloutEvent
-
getModified
Generate a real callout event based on this callout's settings, with an event to base it on.- Parameters:
event
- The event that 'caused' this callout- Returns:
- A CalloutEvent
-
getModified
Generate a real callout event based on this callout's settings, with an event to base it on, plus additional variables.- Parameters:
event
- The event that 'caused' this calloutrawArguments
- Additional variables to be passed to Groovy expressions- Returns:
- A CalloutEvent
-
getModified
Generate a real callout event based on this callout's settings, without an event to base it on, but with additional variables.- Parameters:
rawArguments
- Additional variables to be passed to Groovy expressions- Returns:
- A CalloutEvent
-
durationBasedCall
public static <Y extends HasDuration> ModifiableCallout<Y> durationBasedCall(String desc, String text) Used for things like water stack in TEA or P2S where the callout is based on a buff time or castbar.Just because something *can* be used with this method doesn't mean it should - many buff/castbar mechanics do not warrant this. e.g. if the initial cast merely tells you what you need to do, or if it is expected that the buff will.
- Parameters:
desc
- The description.text
- The base text. For the visual text, the duration will be appended in parenthesis. e.g. "Water on You" will become "Water on You" (123.4) will be appended, and the timer will count down.- Returns:
- the ModifiableCallout
-
durationBasedCall
-
durationBasedCallWithOffset
public static <Y extends HasDuration> ModifiableCallout<Y> durationBasedCallWithOffset(String desc, String text, Duration offset) -
durationBasedCallWithoutDurationText
public static <Y extends HasDuration> ModifiableCallout<Y> durationBasedCallWithoutDurationText(String desc, String text) -
durationExpiryPlusDefaultLinger
-
durationExpiry
-
durationExpiryPlusLingerTime
-
isEnabledByDefault
public boolean isEnabledByDefault() -
getExtendedDescription
-