Respackopts/docs/AdvancedConfig.md

61 lines
1.8 KiB
Markdown
Raw Normal View History

# Advanced config entries
## Common info
Every advanced entry will be represented as a json object.
Every entry can contain the following properties, regardless of its type:
| Name | Required | Description |
| --- | --- | --- |
| type | yes | The type of the entries. Each one can contain specific info, more on that below |
| default | yes | The default value for this entry. This is what you would specify in a normal config entry (except for enums, where this is just the default entries name) |
| reloadType | no | `"Resource"` or `"Simple"`, specifies whether resources have to be reloaded if this is changed. Frex shaders will be reloaded anyways |
## Numbers
There are two ways to display numbers: input boxes and sliders.
Sliders can only be used to select whole numbers but are more intuitive for limited inputs.
They also require a minimum and maximum value to be specified.
### Example:
```json
{
"id": "examplePack",
"version": 6,
"capabilities": ["FileFilter", "DirFilter"],
"conf": {
"someOption": {
"type": "slider", // can also be "number" for a normal number
"default": 5,
"min": 0,
"max": 10
}
}
}
```
### Result:
![configExampleSlider](./img/ExamplePackSlider.png)
## Booleans/Toggles
These do not expose any additional options, look under `Common info`. Their type is `boolean`
## Enum entries/Selecting from a list
The possible values for this entry will be under `values`, while the `default` value will just be a string.
Their type is `enum`
### Example:
```json
{
"id": "examplePack",
"version": 6,
"capabilities": ["FileFilter", "DirFilter"],
"conf": {
"someOption": {
"type": "enum",
"default": "Second",
"values": ["First", "Second", "Third"]
}
}
}
```
### Result:
![configExampleSlider](./img/ExamplePackEnum2.png)