fix: boolean & cycle values not saved properly
This commit is contained in:
parent
2f7c9a883a
commit
d5c9eb6b41
@ -109,17 +109,25 @@ class ProjectionEffectShell(val effect: ProjectionEffect) {
|
|||||||
|
|
||||||
fun intCycle(key: String, property: KMutableProperty0<Int>, range: IntProgression) =
|
fun intCycle(key: String, property: KMutableProperty0<Int>, range: IntProgression) =
|
||||||
row(key) {
|
row(key) {
|
||||||
CycleButton.builder<Int> { Component.literal(it.toString()) }
|
CycleButton.builder<Int> {
|
||||||
|
property.set(it)
|
||||||
|
Component.literal(it.toString())
|
||||||
|
}
|
||||||
.displayOnlyValue()
|
.displayOnlyValue()
|
||||||
.withValues(range.toList())
|
.withValues(range.toList())
|
||||||
|
.withInitialValue(property.get())
|
||||||
.create(0, 0, width, height, Component.translatable(key))
|
.create(0, 0, width, height, Component.translatable(key))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun boolean(key: String, property: KMutableProperty0<Boolean>) =
|
fun boolean(key: String, property: KMutableProperty0<Boolean>) =
|
||||||
row(key) {
|
row(key) {
|
||||||
CycleButton.builder<Boolean> { Component.translatable("$key.$it") }
|
CycleButton.builder<Boolean> {
|
||||||
|
property.set(it)
|
||||||
|
Component.translatable("$key.$it")
|
||||||
|
}
|
||||||
.displayOnlyValue()
|
.displayOnlyValue()
|
||||||
.withValues(listOf(true, false))
|
.withValues(listOf(true, false))
|
||||||
|
.withInitialValue(property.get())
|
||||||
.create(0, 0, width, height, Component.translatable(key))
|
.create(0, 0, width, height, Component.translatable(key))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user