Fix retaining of Boolean values in orx-gui

This commit is contained in:
Edwin Jakobs
2020-02-14 00:13:50 +01:00
parent cfdb8b7cd1
commit f446aab9e8

View File

@@ -321,10 +321,13 @@ class GUI : Extension {
label = parameter.label
events.valueChanged.subscribe {
value = it.newValue
(parameter.property as KMutableProperty1<Any, Boolean>).set(obj, it.newValue)
setAndPersist(compartment.label, parameter.property as KMutableProperty1<Any, Boolean>, obj, it.newValue)
onChangeListener?.invoke(parameter.property!!.name, it.newValue)
}
value = (parameter.property as KMutableProperty1<Any, Boolean>).get(obj)
getPersistedOrDefault(compartment.label, parameter.property as KMutableProperty1<Any, Boolean>, obj)?.let {
value = it
setAndPersist(compartment.label, parameter.property as KMutableProperty1<Any, Boolean>, obj, it)
}
}
}
ParameterType.Text -> {