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.

@param

The dynamic draw data


Type parameters

  • PersistentData: Record<string, any> = Record<string, unknown>

BeforeDraw

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

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

@param

The dynamic draw data

@returns

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


Type parameters

  • PersistentData: Record<string, any> = Record<string, unknown>

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.

@param

The character that has the item equiped

@param

The item in question

@param

Whether to push to changes to the server

@param

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

@returns

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.

@param

The character that has the item equiped

@param

The item in question

@param

The newly selected extended item option

@param

The previusly selected extended item option


Type parameters

ScriptDraw

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

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

@param

The dynamic draw data


Type parameters

  • PersistentData: Record<string, any> = Record<string, unknown>

SetOption

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

Callback for extended item SetOption functions.

@param

The character that has the item equiped

@param

The item in question

@param

The newly selected extended item option

@param

The previusly selected extended item option

@param

Whether to push to changes to the server

@param

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


Type parameters

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.

@param

The character that has the item equiped

@param

The item in question

@param

The newly selected extended item option

@param

The previusly selected extended item option

@param

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

@returns

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


Type parameters