InvUI/invui-kotlin/src/main/kotlin/xyz/xenondevs/invui/adventure/AdventureWindowContexts.kt
NichtStudioCode 3d4e062901 Improved window building
- Removed the "retain" parameter from Windows - all Windows can now be closed and reopened
- Added open handlers to Windows
- Added quick build methods Window.Builder.build(Player) and Window.Builder.show(Player)
- Added some NotNull annotations
2023-03-03 17:36:07 +01:00

17 lines
528 B
Kotlin

@file:Suppress("PackageDirectoryMismatch")
package xyz.xenondevs.invui.window.type.context
import net.kyori.adventure.text.Component
import org.jetbrains.annotations.Contract
import xyz.xenondevs.inventoryaccess.component.AdventureComponentWrapper
import xyz.xenondevs.invui.window.Window
/**
* Sets the title of the window.
*
* @param title the new title
* @return This Window Builder
*/
@Contract("_ -> this")
fun <B : Window.Builder<*, B>> B.setTitle(title: Component): B = setTitle(AdventureComponentWrapper(title))