2021-09-15 15:17:32 +02:00
# Creating a Screen
2021-08-30 14:38:03 +02:00
2022-02-19 15:10:53 +01:00
## Before we begin
2021-09-14 19:46:33 +02:00
Any pack id or config entry name MUST only contain alphabetical characters (no numbers, spaces, underscores, etc) and SHOULD be in [camelCase ](https://en.wikipedia.org/wiki/Camel_case ).
If that is not the case, you may face unexpected issues.
2021-09-09 18:18:47 +02:00
You can add [translations ](./Translations.md ) to work around this in the UI shown to users though.
2021-08-30 14:38:03 +02:00
### Location (ResourcePacks).
> `/assets/respackopts/conf.json`
### Location (DataPacks).
> `/data/respackopts/conf.json`
2022-02-19 15:10:53 +01:00
### What needs to be here.
2021-08-30 14:38:03 +02:00
```json
{
2022-06-07 23:23:14 +02:00
id: "< PackID > ",
version: 8,
capabilities: ["FileFilter", "DirFilter"],
conf: {
2021-08-30 14:38:03 +02:00
// Your config options here
}
}
```
### Capabilities:
> **FileFilter:** (Default Enabled) <br> If stated will enable file filtering functionality.
> **DirFilter:** (Default Disabled) <br> If stated will enable folder filtering functionality.
> **DirFilterAdditive:** (Default Disabled) <br> If stated this will enable a compatibility fix for some mods that also modify resources.
## Adding a Toggle/Boolean
2021-08-30 15:03:33 +02:00
To add a boolean entry, add code like this: `"entryName": <Default Option (true/false)>`
2021-08-30 14:38:03 +02:00
### Example:
```json
{
2022-06-07 23:23:14 +02:00
id: "examplePack",
version: 8,
capabilities: ["FileFilter", "DirFilter"],
conf: {
someTexture: true,
someOtherTexture: false
2021-08-30 14:38:03 +02:00
}
}
```
### Result:
2021-08-30 15:03:33 +02:00
![configExampleBoolean ](./img/ExamplePackBoolean.png "ConfigExampleBolean" )
2021-08-30 14:38:03 +02:00
2021-08-30 15:03:33 +02:00
### See [ToggleFiles](./ToggleFiles.md) to see the logic behind this
2021-08-30 14:38:03 +02:00
## Adding a Free Number Box
2021-08-30 15:03:33 +02:00
A number box follows the same principle as a boolean: `"entryName": Default Number`
2021-08-30 14:38:03 +02:00
*please note any value can be put in here with no limit*
### Example:
```json
{
2022-06-07 23:23:14 +02:00
id: "examplePack",
version: 8,
capabilities: ["FileFilter", "DirFilter"],
conf: {
someOption: 10
2021-08-30 14:38:03 +02:00
}
}
```
### Result:
![configExampleNumber ](./img/ExamplePackNumber.png "ConfigExampleNumber" )
## Adding a slider
A slider is slightly more complicated as a minimum and a maximum need to be defined. Sliders also only support whole numbers.
2021-10-03 16:45:29 +02:00
More information is available [here ](AdvancedConfig.md )
2021-08-30 14:38:03 +02:00
## Select From a list
To allow users to select one entry from a list, you can use a json array with string entries. *Numbers/etc are not supported*
### Example:
```json
{
2022-06-07 23:23:14 +02:00
id: "examplePack",
version: 8,
capabilities: ["FileFilter", "DirFilter"],
conf: {
someOption: [
2021-08-30 15:03:33 +02:00
"optionOne",
"optionTwo",
"optionThree"
2021-08-30 14:38:03 +02:00
]
}
}
```
### Result:
![configExampleEnum ](./img/ExamplePackEnum.png )
## Make a category
### Example:
```json
{
2022-06-07 23:23:14 +02:00
id: "examplePack",
version: 8,
capabilities: ["FileFilter", "DirFilter"],
conf: {
someCategory: {
someBoleanOption: true,
someNumberOption: 5,
someSelectionOption: [
optionOne,
optionTwo,
optionThree
2021-08-30 14:38:03 +02:00
],
2022-06-07 23:23:14 +02:00
someSliderOption: {
min: 0,
default: 5,
max: 10
2021-08-30 14:38:03 +02:00
}
},
2022-06-07 23:23:14 +02:00
someotherCategory: {
someOtherBoleanOption: true,
someOtherNumberOption: 5
2021-08-30 14:38:03 +02:00
}
}
}
```
### Result:
![configExampleCategory ](./img/ExamplePackCategory.png )