Config Options
Here you will learn how to create options inside OneConfig.
Adding options
Creation
Options are added with Java annotations. Any field you annotate with an option will be saved to your config file, which you earlier specified in it's constructor. It'll then be displayed to the user within the OneConfig GUI.
Accessing
Retrieving the value of your options is incredibly easy, as seen in the example below!
Subcategories and Options are displayed in the order they are put in the config. You can have multiple subcategories with the same name, but this is not recommended unless it genuinely makes sense (e.g. "HUD Options" for two separate types of HUDs).
Disabling Options
Disabled options are still visible to the user, but cannot be interacted with. You can disable them by adding dependencies.
If you wish to do this, go back to your config's constructer, and put in an addDependency
line, as seen below. The first argument will specify which variable should be edited, given the value of the second argument.
Other option features
Sizes
Options come in two sizes in the GUI, SINGLE
and DUAL
. These are stored in a simple enum called OptionSize
. Here is what a single and dual Text Field look like:
Option types
There are lots to choose from, so what are you waiting for?
Last updated