Skip to main content

ExtendedItemScriptHookCallbacks

Namespace with item-specific script hooks used for constructing typical extended items functions.

@see

Index

Type Aliases

AfterDraw

AfterDraw<DataType, PersistentData>: ExtendedItemScriptHookCallback<DataType, [drawData: DynamicDrawingData<PersistentData>]>

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

@param

The items extended item data

@param

The function (if any) that is normally called when an archetypical item reaches this point

@param

The dynamic draw data


Type parameters

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

BeforeDraw

BeforeDraw<DataType, PersistentData>: ExtendedItemScriptHookCallback<DataType, [drawData: DynamicDrawingData<PersistentData>], DynamicBeforeDrawOverrides>

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

@param

The items extended item data

@param

The function (if any) that is normally called when an archetypical item reaches this point

@param

The dynamic draw data

@returns

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


Type parameters

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

Click

Click<DataType>: ExtendedItemScriptHookCallbackNoNull<DataType, []>

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

@param

The items extended item data

@param

The function that is normally called when an archetypical item reaches this point


Type parameters

Draw

Draw<DataType>: ExtendedItemScriptHookCallbackNoNull<DataType, []>

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

@param

The items extended item data

@param

The function that is normally called when an archetypical item reaches this point


Type parameters

Exit

Exit<DataType>: ExtendedItemScriptHookCallback<DataType, []>

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

@param

The items extended item data

@param

The function (if any) that is normally called when an archetypical item reaches this point


Type parameters

Init

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

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

@param

The items extended item data

@param

The function (if any) that is normally called when an archetypical item reaches this point

@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


Type parameters

Load

Load<DataType>: ExtendedItemScriptHookCallbackNoNull<DataType, []>

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

@param

The items extended item data

@param

The function that is normally called when an archetypical item reaches this point


Type parameters

PublishAction

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

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

@param

The items extended item data

@param

The function (if any) that is normally called when an archetypical item reaches this point

@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<DataType, PersistentData>: ExtendedItemScriptHookCallback<DataType, [drawData: DynamicScriptCallbackData<PersistentData>]>

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

@param

The items extended item data

@param

The function (if any) that is normally called when an archetypical item reaches this point

@param

The dynamic draw data


Type parameters

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

SetOption

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

Callback for extended item SetOption functions.

@param

The items extended item data

@param

The function that is normally called when an archetypical item reaches this point

@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.

@returns

Type parameters

Validate

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

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

@param

The items extended item data

@param

The function (if any) that is normally called when an archetypical item reaches this point

@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