Added default parameters
This commit is contained in:
@@ -8,7 +8,7 @@ import kotlin.math.absoluteValue
|
|||||||
|
|
||||||
fun <T : ForInventory> kSpigotGUI(
|
fun <T : ForInventory> kSpigotGUI(
|
||||||
type: GUIType<T>,
|
type: GUIType<T>,
|
||||||
guiCreator: GUICreator<T>,
|
guiCreator: GUICreator<T> = IndividualGUICreator(),
|
||||||
builder: GUIBuilder<T>.() -> Unit,
|
builder: GUIBuilder<T>.() -> Unit,
|
||||||
) = GUIBuilder(type, guiCreator).apply(builder).build()
|
) = GUIBuilder(type, guiCreator).apply(builder).build()
|
||||||
|
|
||||||
|
@@ -9,8 +9,8 @@ class SharedGUICreator<T : ForInventory> : GUICreator<T>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class IndividualGUICreator<T : ForInventory>(
|
class IndividualGUICreator<T : ForInventory>(
|
||||||
private val resetOnClose: Boolean,
|
private val resetOnClose: Boolean = true,
|
||||||
private val resetOnQuit: Boolean
|
private val resetOnQuit: Boolean = true
|
||||||
) : GUICreator<T>() {
|
) : GUICreator<T>() {
|
||||||
override fun createInstance(guiData: GUIData<T>) = GUIIndividual(guiData, resetOnClose, resetOnQuit)
|
override fun createInstance(guiData: GUIData<T>) = GUIIndividual(guiData, resetOnClose, resetOnQuit)
|
||||||
}
|
}
|
Reference in New Issue
Block a user