WidgetEntry

open class WidgetEntry<T : Selectable, Element, Drawable, Widget>(parentElement: DynamicListWidget, val scope: String, val texts: Translatable.Result, height: Int, widget: T) : DynamicListWidget.Entry

Basic DynamicListWidget.Entry that wraps a single widget with no other bells and whistles.

Author

fzzyhmstrs

Since

0.6.5

Parameters

T

the widget type; must be all of Selectable, Element, Drawable, and Widget

parentElement

DynamicListWidget parent instance. This will almost always be automatically provided via the BiFunction builder system the list widget uses.

scope

String scope representation of this entry in the list. Might be as simple as "0", "1" etc. string version of the entry index.

texts

Translatable.Result translation result to pass into the base entry. This is used for searching and so on. An empty result can be provided if these features aren't used.

height

Integer height of the entry.

widget

T the widget to wrap.

Constructors

Link copied to clipboard
constructor(parentElement: DynamicListWidget, scope: String, texts: Translatable.Result, height: Int, widget: T)

Properties

Link copied to clipboard
open override var lastSelected: Element?

getter and setter for the cached element.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val skip: Boolean

Whether the search should exclude this content from search results. This is active state, so can change between true and false as needed.

Link copied to clipboard
open override val texts: Translatable.Result

Functions

Link copied to clipboard
open override fun appendNarrations(builder: NarrationMessageBuilder)

Append narration messages to current NarrationMessageBuilder. The list will handle list position and navigation, the entry should focus on providing title and description information, and internal navigation information as applicable (if there are multiple children in one entry for example)

Link copied to clipboard
open fun appendTitleNarrations(builder: NarrationMessageBuilder)
Link copied to clipboard
fun atY(mouseY: Int): Boolean
Link copied to clipboard
open fun charTyped(chr: Char, modifiers: Int): Boolean
Link copied to clipboard
open override fun children(): MutableList<out Element>
Link copied to clipboard
open override fun getFocused(): Element?
Link copied to clipboard
open override fun getFocusedPath(): GuiNavigationPath?
Link copied to clipboard
open override fun getNavigationFocus(): ScreenRect
Link copied to clipboard
Link copied to clipboard
open override fun getNavigationPath(navigation: GuiNavigation): GuiNavigationPath?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun handleContext(contextType: ContextType, position: Position): Boolean

Handle a context event. This will be triggered by a parent, typically on key press or mouse click. A parent object can of course also be a context handler, handle context as applicable and then pass the event downstream for further handling.

Link copied to clipboard
open fun hoveredElement(mouseX: Double, mouseY: Double): Optional<Element>
Link copied to clipboard
open fun init()

Applied when the entry is added to an entries list for the first time. Generally this will happen when the Dynamic List is displayed. This may happen more than once, if an entry is removed or added (the entries list is rebuilt).

Link copied to clipboard
open override fun isDragging(): Boolean
Link copied to clipboard
open override fun isFocused(): Boolean
Link copied to clipboard
open override fun isMouseOver(mouseX: Double, mouseY: Double): Boolean
Link copied to clipboard
open fun keyPressed(keyCode: Int, scanCode: Int, modifiers: Int): Boolean
Link copied to clipboard
open fun keyReleased(keyCode: Int, scanCode: Int, modifiers: Int): Boolean
Link copied to clipboard
open override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean
Link copied to clipboard
open fun mouseDragged(mouseX: Double, mouseY: Double, button: Int, deltaX: Double, deltaY: Double): Boolean
Link copied to clipboard
open fun mouseMoved(mouseX: Double, mouseY: Double)
Link copied to clipboard
open fun mouseReleased(mouseX: Double, mouseY: Double, button: Int): Boolean
Link copied to clipboard
open fun mouseScrolled(mouseX: Double, mouseY: Double, horizontalAmount: Double, verticalAmount: Double): Boolean
Link copied to clipboard
fun onAdd(parentPos: Pos, previous: DynamicListWidget.Entry?, last: Boolean)
Link copied to clipboard
open fun onResize()

Applied when the parent Dynamic List is resized. This should handle any reorganization/repositioning of children.

Link copied to clipboard
open fun onScroll(dY: Int)

Applied when the Dynamic List is scrolled. Use this to move children to match the scroll, as applicable.

Link copied to clipboard
open override fun popLast()

Indicates that the overlay has been removed and the parent should return focus to the cached element, if any, in lastSelected

Link copied to clipboard
open override fun provideContext(builder: ContextResultBuilder)

Add a set of grouped context action builders to a result

Link copied to clipboard
open override fun pushLast()

Indicates to the parent element to cache it's current focused element. The current focused element should be stored in lastSelected

Link copied to clipboard
open override fun render(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float)

Renders the entry. This is the base method of CustomListWidget.Entry and generally shouldn't be overridden directly.

Link copied to clipboard
open fun renderBorder(context: DrawContext, x: Int, y: Int, width: Int, height: Int, mouseX: Int, mouseY: Int, hovered: Boolean, focused: Boolean, delta: Float)

Render call for drawing a border on the entry, as applicable. This happens before, therefor "under" the main entry render calls.

Link copied to clipboard
open override fun renderEntry(context: DrawContext, x: Int, y: Int, width: Int, height: Int, mouseX: Int, mouseY: Int, hovered: Boolean, focused: Boolean, delta: Float)

Base render method for the entry.

Link copied to clipboard
fun renderExtras(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float)

open fun renderExtras(context: DrawContext, x: Int, y: Int, width: Int, height: Int, mouseX: Int, mouseY: Int, hovered: Boolean, focused: Boolean, delta: Float)

Render call for rendering anything else related to the entry. This call is not bound by a render scissor, so you can draw "out of bounds" as needed.

Link copied to clipboard
open fun renderHighlight(context: DrawContext, x: Int, y: Int, width: Int, height: Int, mouseX: Int, mouseY: Int, hovered: Boolean, focused: Boolean, delta: Float)

Render call for drawing an entry background highlight. This happens before, therefor "under" both the entry and border render calls

Link copied to clipboard
open fun resetHover(mouseX: Double, mouseY: Double)

When called the parent element should reselect a hovered element based on the supplied mouse positions, if it tracks such things

Link copied to clipboard
fun scroll(dY: Int)
Link copied to clipboard

The children of the entry that comply to SelectableElement, that is both Selectable and an Element

Link copied to clipboard
open override fun setDragging(dragging: Boolean)
Link copied to clipboard
open override fun setFocused(focused: Boolean)
open override fun setFocused(focused: Element?)
Link copied to clipboard
open override fun toString(): String