Custom Mod Settings and GLobal Settings(26.4.0+)
This will make mod has own setting. such like mod config or mod sensitive content toggle etc.
Json Fields
| Field | Type | Description | Default | Mod Setting | Global Setting | Required |
|---|---|---|---|---|---|---|
| bgColor | String | custom setting background color. | #ea71fd | ✓ | ✓ | ✗ |
| storageKey | String | storage key for setting. And also can use for lua variable prefix. | %modfoldername% | ✓ | ✓ | ✗ |
| settingName | String | setting name for title and options name. | Global Setting | ✗ | ✓ | ✗ |
| optionsList | Options Array |
storage key for setting. And also can use for lua variable prefix. | - | ✓ | ✓ | ✓ |
Options Array Fields
| Field | Type | Description | Default | Required | Bool | Float | Int | Percent | String | String(Free) | HEX | Allowed Value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | String | Options Label Name. | No Name | ✗ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| description | String | Options Description. | No Description. | ✗ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| type | String | Options Types. | bool | ✗ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | int, float, percent, bool, string, stringfree(26.5.0+), hex(26.5.0+). Option Types. |
| variable | String | Options Variable(must be unique). And also can use for lua variable. | unknown | ✗ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| defaultValue | Dynamic | Default Value Settings. | false | ✗ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| options | Array | Array list for selected text. | - | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | - |
for more Options List Field Check in Option.hx.
Option Types
| Type | Allowed Value |
|---|---|
| Bool | true, false |
| Float | X.X |
| Int | X |
| Percent | X.X(Same Like Float) |
| String | - |
| String(Free) | - |
| HEX | RRGGBB |
Mod Settings
Open in Mods Menu.
file location: mods/%modfoldername%/settings.json.
example json settings.json:
{
"bgColor": "#FF0000",
"storageKey": "customModSetting",
"optionsList": [
{"name": "bool setting", "variable": "boolsetting", "type": "bool", "defaultValue": true},
{"name": "float setting", "variable": "floatsetting", "type": "float", "defaultValue": 1.1},
{"name": "int setting", "variable": "intsetting", "type": "int", "defaultValue": 1},
{"name": "percent setting", "variable": "percentsetting", "type": "percent", "defaultValue": 0.9},
{"name": "string setting", "variable": "stringsetting", "type": "string", "defaultValue": "type 1", "options": ["type 1", "type 2", "type 3"]},
{"name": "string free setting", "variable": "stringfreesetting", "type": "stringfree", "defaultValue": "text default"},
{"name": "hex setting", "variable": "hexsetting", "type": "hex", "defaultValue": "FF0000"}
]
}
Global Mod Settings
Open in Main Options Menu.
file location: mods/settings.json.
example json settings.json:
{
"bgColor": "#FF0000",
"storageKey": "customGlobalModSetting",
"settingName": "Custom Global Mod Setting"
"optionsList": [
{"name": "bool setting", "variable": "boolsetting", "type": "bool", "defaultValue": true},
{"name": "float setting", "variable": "floatsetting", "type": "float", "defaultValue": 1.1},
{"name": "int setting", "variable": "intsetting", "type": "int", "defaultValue": 1},
{"name": "percent setting", "variable": "percentsetting", "type": "percent", "defaultValue": 0.9},
{"name": "string setting", "variable": "stringsetting", "type": "string", "defaultValue": "type 1", "options": ["type 1", "type 2", "type 3"]},
{"name": "string free setting", "variable": "stringfreesetting", "type": "stringfree", "defaultValue": "text default"},
{"name": "hex setting", "variable": "hexsetting", "type": "hex", "defaultValue": "FF0000"}
]
}