1
0
Fork 0

Support string->value conversions for Diopser's most important parameter

This commit is contained in:
Robbert van der Helm 2022-07-02 00:45:01 +02:00
parent 32ad1212f1
commit 883b43b6a7

View file

@ -202,6 +202,16 @@ impl DiopserParams {
.with_value_to_string(Arc::new(|value| {
String::from(if value { "please don't" } else { "stop it" })
}))
.with_string_to_value(Arc::new(|string| {
let string = string.trim();
if string.eq_ignore_ascii_case("please don't") {
Some(true)
} else if string.eq_ignore_ascii_case("stop it") {
Some(false)
} else {
None
}
}))
.hide_in_generic_ui(),
automation_precision: FloatParam::new(