Enchant
Manages the enchanting interface for applying abilities to items
Constructor Summary
| Public Constructor | ||
| public |
constructor(game: Game, intrface: Interface) Default constructor |
|
Member Summary
| Public Members | ||
| public |
body: jQuery The enchant dialog body element |
|
| public |
confirm: jQuery The confirm enchant button element |
|
| public |
container: jQuery The enchant container element |
|
| public |
enchantSlots: jQuery The enchant inventory slots element |
|
| public |
The game instance |
|
| public |
The game interface instance |
|
| public |
selectedItem: jQuery The selected item slot display element |
|
| public |
selectedShards: jQuery The selected shards slot display element |
|
| public |
shardsCount: jQuery The shards count display element |
|
Method Summary
| Public Methods | ||
| public |
Moves an item from the inventory slot into the selected item or shards display |
|
| public |
display() Shows the enchant dialog and loads the current inventory into it |
|
| public |
enchant() Sends an enchant action packet to the server |
|
| public |
Returns the number of slots in the player's inventory |
|
| public |
getItemSlot(index: Number): Slot Returns the slot data for the given inventory index |
|
| public |
Returns the slot list item element at the given index |
|
| public |
getSlots(): jQuery Returns the unordered list element containing all enchant slots |
|
| public |
Returns whether the given image element has a background image set |
|
| public |
hide() Hides the enchant dialog and clears the selected item and shards |
|
| public |
Returns whether the enchant dialog is currently visible |
|
| public |
Loads the inventory slot list into the enchant interface from the bank inventory |
|
| public |
Moves an item back from the selected display into its original inventory slot |
|
| public |
Sends a remove packet to the server for the given slot type |
|
| public |
select(event: Event) Sends a slot selection packet to the server |
|
Public Constructors
Public Members
Public Methods
public add(type: String, index: Number) source
Moves an item from the inventory slot into the selected item or shards display
public getItemSlot(index: Number): Slot source
Returns the slot data for the given inventory index
Params:
| Name | Type | Attribute | Description |
| index | Number | the inventory slot index |
public getSlot(index: Number): jQuery source
Returns the slot list item element at the given index
Params:
| Name | Type | Attribute | Description |
| index | Number | the slot index |
Return:
| jQuery |
public getSlots(): jQuery source
Returns the unordered list element containing all enchant slots
Return:
| jQuery |
public hasImage(image: jQuery): Boolean source
Returns whether the given image element has a background image set
Params:
| Name | Type | Attribute | Description |
| image | jQuery | the image element to check |
public loadEnchant() source
Loads the inventory slot list into the enchant interface from the bank inventory
public moveBack(type: String, index: Number) source
Moves an item back from the selected display into its original inventory slot
public remove(type: String) source
Sends a remove packet to the server for the given slot type
Params:
| Name | Type | Attribute | Description |
| type | String | the slot type to remove, either 'item' or 'shards' |
public select(event: Event) source
Sends a slot selection packet to the server
Params:
| Name | Type | Attribute | Description |
| event | Event | the click event from the inventory slot element |
Reference
Source
Test
