YetAnotherConfigLib
Search…
⌃K

Controllers

In-depth review of each built-in Controller types.
There are many different built-in controllers to get you set up quickly.
BooleanController
A toggleable controller that displays a different Text based on the state of the option.
.controller(BooleanController::new)
  • valueFormatter parameter is a function to return Text based on the state of the option. (optional)
  • coloured parameter is a boolean that colours the returned text red or green based on the state. (optional)
To pass extra parameters, you need to construct a BooleanController like so.
.controller(opt -> new BooleanController(opt, valueFormatter, coloured))
TickBoxController
A toggleable controller that displays a tick box.
.controller(TickBoxController::new)
There are no optional parameters for this controller.
<Number>SliderController
Replace <Number> with either Double, Float, Integer and Long.
Slider controllers take a minimum, a maximum and an interval for the slider in their respected number types.
.controller(opt -> new <Number>SliderController(opt, min, max, interval))
Sliders can also take a valueFormatter to return a Text based on the slider value.
.controller(opt -> new <Number>SliderController(opt, min, max, interval, valueFormatter))
Last modified 2mo ago