Skip to main content

ExtendedItemCallbacks

Namespace with item-specific functions typically called by extended items.

Index

Type Aliases

AfterDraw

AfterDraw<PersistentData>: ExtendedItemCallback<[drawData: DynamicDrawingData<PersistentData>]>

Callback for extended item AfterDraw functions. Relevant for assets that define Asset.DynamicAfterDraw.


Type parameters

The dynamic draw data

BeforeDraw

BeforeDraw<PersistentData>: ExtendedItemCallback<[drawData: DynamicDrawingData<PersistentData>], DynamicBeforeDrawOverrides | undefined>

Callback for extended item BeforeDraw functions. Relevant for assets that define Asset.DynamicBeforeDraw.


Type parameters

The dynamic draw data

A record with any and all to-be overriden draw data

Click

Callback for extended item Click functions. Click functions are responsible for managing any mouse clicks within the extended item menu.

Draw

Callback for extended item Draw functions. Draw functions are responsible for drawing any UI elements within the extended item menu.

Exit

Callback for extended item Exit functions. Exit functions are responsible for cleaning up any UI elements when closing the extended item menu.

Init

Init: ExtendedItemCallback<[C: Character, item: Item, push: boolean, refresh: boolean], boolean>

Callback for extended item Init functions. Init functions are responsible for setting the initial properties of an extended item.

The character that has the item equipped

The item in question

Whether to push to changes to the server

Whether to refresh the character. This should generally be true, with custom script hooks being a potential exception.

Whether the items properties were actually updated or not

Load

Callback for extended item Load functions. Load functions are responsible for setting up the UI when initially opening the extended item menu.

PublishAction

PublishAction<OptionType>: ExtendedItemCallback<[C: Character, item: Item, newOption: OptionType, previousOption: OptionType]>

Callback for extended item PublishAction functions. PublishAction functions are responsible for reporting any changes to an item's properties via a chat message.


Type parameters

The character that has the item equipped

The item in question

The newly selected extended item option

The previously selected extended item option

ScriptDraw

ScriptDraw<PersistentData>: ExtendedItemCallback<[drawData: DynamicScriptCallbackData<PersistentData>]>

Callback for extended item ScriptDraw functions. Relevant for assets that define Asset.DynamicScriptDraw.


Type parameters

The dynamic draw data

SetOption

SetOption<OptionType>: ExtendedItemCallback<[C: Character, item: Item, newOption: OptionType, previousOption: OptionType, push: boolean, refresh: boolean]>

Callback for extended item SetOption functions.


Type parameters

The character that has the item equipped

The item in question

The newly selected extended item option

The previously selected extended item option

Whether to push to changes to the server

Whether to refresh the character. This should generally be true, with custom script hooks being a potential exception.

Validate

Validate<OptionType>: ExtendedItemCallback<[C: Character, item: Item, newOption: OptionType, previousOption: OptionType, permitExisting?: boolean], string>

Callback for extended item Validate functions. Validate functions are responsible for validating any change in an item's properties.


Type parameters

The character that has the item equipped

The item in question

The newly selected extended item option

The previously selected extended item option

Determines whether the validation should allow the new option and previous option to be identical. Defaults to false.

A non-empty message string if the item failed validation, or an empty string otherwise