KPageImpl

class KPageImpl(var title: Component?, val rowLength: Int = 9, val size: Int = 3.rows) : AbstractContentContainer, KPage

Constructors

Link copied to clipboard
constructor(title: Component?, rowLength: Int = 9, size: Int = 3.rows)

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
open override var currentAnimation: Animation<KPage>?

The current animation if one is running

Link copied to clipboard
open override 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
open override 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
open override var openingAnimation: Animation<KPage>?

Animation played as soon as the page is opened

Link copied to clipboard
open override var parent: KPageInventory?

Parent inventory if the page is set in it

Link copied to clipboard

the length of a row in the inventory

Link copied to clipboard
val size: Int

of the content container, should be a multiple of the rowLength

Link copied to clipboard
open override 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
open override 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
open override fun closed(inventory: KPageInventory)

Called by the parent inventory, when the page is closed

Link copied to clipboard
open 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
open override fun hasFooter(): Boolean
Link copied to clipboard
open override fun hasHeader(): Boolean
Link copied to clipboard
open override fun isAnimating(): Boolean

Whether the object is currently inside an animation

Link copied to clipboard
open override 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
open override 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
open override fun opened(inventory: KPageInventory)

Called by the parent inventory, when the page is opened

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

Sets the given item at the given position

open override fun setItem(row: Int, slot: Int, item: KItem)

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

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

Sets the given row at the given index

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

Starts the given animation, but will not save it

open override 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