KPage

Models a page inside a paging KInventory

Author

Devin

Since

1.0.0

See also

Inheritors

Properties

Link copied to clipboard

All animations Identifier maps to the animation

Link copied to clipboard
abstract val content: MutableMap<Int, KItem>

Content of the container

Link copied to clipboard

The current animation if one is running

Link copied to clipboard
abstract var footer: KPageController?

The footer will only be rendered, if the inventory is at least 2 rows long, and has no header, or is 3 rows long

Link copied to clipboard
abstract var header: KPageController?

The header will only be rendered, if the inventory is at least 2 rows long, and has no footer, or is 3 rows long

Link copied to clipboard

Animation played as soon as the page is opened

Link copied to clipboard
abstract var parent: KPageInventory?

Parent inventory if the page is set in it

Link copied to clipboard
abstract var title: Component?

Title of the page which will be rendered, can be configured using the TitleBuilder in the Parent Inventory

Functions

Link copied to clipboard
abstract fun addAnimation(identifier: String, animation: Animation<KPage>)

Adds the animation

Link copied to clipboard
abstract fun clearInventory()

Clears the inventory from all items inside it

Link copied to clipboard
abstract fun closed(inventory: KPageInventory)

Called by the parent inventory, when the page is closed

Link copied to clipboard
abstract override fun getRowFor(index: Int): KRow

Returns the given row for the index as a new object Parent of the row will only be set, if the page has a parent as well

Link copied to clipboard
abstract fun hasFooter(): Boolean
Link copied to clipboard
abstract fun hasHeader(): Boolean
Link copied to clipboard
abstract fun isAnimating(): Boolean

Whether the object is currently inside an animation

Link copied to clipboard
abstract fun onClosed(action: KPage.(parent: KPageInventory) -> Unit)

Hook called when the page is closed, either when the page is clicked away, or the inventory is closed when the page is active

Link copied to clipboard
abstract fun onOpened(action: KPage.(parent: KPageInventory) -> Unit)

Hook called when the page is opened, either when the page is clicked to, or it's the first page of the parent inventory

Link copied to clipboard
abstract fun opened(inventory: KPageInventory)

Called by the parent inventory, when the page is opened

Link copied to clipboard
abstract fun setItem(slot: Int, value: KItem)

Sets the given item at the given position

abstract fun setItem(row: Int, slot: Int, item: KItem)

Sets the given item relative to the slot of the given row

Link copied to clipboard
abstract fun setRow(index: Int, row: KRow)

Sets the given row at the given index

Link copied to clipboard
abstract fun startAnimation(animation: Animation<KPage>)

Starts the given animation, but will not save it

abstract fun startAnimation(identifier: String)

Starts the animation with the given identifier

Link copied to clipboard
abstract fun swapRow(row: KRow, otherRow: KRow)

Swaps two rows in an inventory

abstract fun swapRow(index: Int, otherIndex: Int)

Swaps two rows based on their index