{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/Exit-9B/StartGameSettings/main/docs/StartGameSettings.schema.json", "title": "Start Game Settings", "description": "Defines settings to appear in the main menu", "type": "object", "properties": { "NewGame": { "description": "Settings for the new game panel", "type": "array", "items": { "$ref": "#/$defs/item" } } }, "$defs": { "localizedString": { "type": "string", "oneOf": [ { "pattern": "^\\d*$" }, { "pattern": "^[^\\$]", "description": "WARNING: String will not be localized", "deprecated": true }, { "pattern": "^\\$", "description": "Localized string" } ] }, "form": { "description": "Look up a Form by a plugin file and Form ID (e.g. \"MyMod.esp|D62\")", "type": "string", "pattern": "^[^\\\\\\/:*?\"<>|]+\\.es[lmp]\\|(0[Xx])?[\\dA-Fa-f]{1,8}$" }, "item": { "description": "Setting item specification", "type": "object", "properties": { "type": { "description": "Setting type", "enum": [ "slider", "stepper", "toggle" ] }, "text": { "description": "Text label for the setting", "allOf": [ { "$ref": "#/$defs/localizedString" } ] }, "id": { "description": "Key for locating the setting's value from its source", "type": "string" }, "groupCondition": { "$ref": "#/$defs/groupCondition" }, "action": { "$ref": "#/$defs/action" } }, "allOf": [ { "$comment": "Slider properties", "if": { "properties": { "type": { "const": "slider" } } }, "then": { "properties": { "help": { "$ref": "#/$defs/help-text" }, "valueOptions": { "type": "object", "properties": { "min": { "type": "number" }, "max": { "type": "number" }, "step": { "type": "number" } }, "allOf": [ { "$ref": "#/$defs/valueOptions-valueSource" } ] } } } }, { "$comment": "Stepper properties", "if": { "properties": { "type": { "const": "stepper" } } }, "then": { "properties": { "help": { "$ref": "#/$defs/help-text-or-array" }, "valueOptions": { "type": "object", "properties": { "options": { "type": "array", "items": { "$ref": "#/$defs/localizedString" } } }, "allOf": [ { "$ref": "#/$defs/valueOptions-valueSource" } ] }, "groupControl": { "type": "array", "items": { "oneOf": [ { "type": "integer", "minimum": 1 }, { "type": "null" } ] } } } } }, { "$comment": "Toggle properties", "if": { "properties": { "type": { "const": "toggle" } } }, "then": { "properties": { "help": { "$ref": "#/$defs/help-text" }, "valueOptions": { "type": "object", "allOf": [ { "$ref": "#/$defs/valueOptions-valueSource" } ] }, "groupControl": { "type": "integer", "minimum": 1 } } } } ], "required": ["type", "text"] }, "help-text": { "description": "Description text for the setting", "allOf": [ { "$ref": "#/$defs/localizedString" } ] }, "help-text-or-array": { "oneOf": [ { "$ref": "#/$defs/help-text" }, { "type": "array", "items": { "description": "Description text for the corresponding option", "allOf": [ { "$ref": "#/$defs/localizedString" } ] } } ] }, "groupCondition": { "description": "Condition tree for enabling this control", "oneOf": [ { "type": "integer", "minimum": 1 }, { "type": "array", "items": { "$ref": "#/$defs/groupCondition" } }, { "type": "object", "properties": { "OR": { "$ref": "#/$defs/groupCondition" }, "AND": { "$ref": "#/$defs/groupCondition" }, "ONLY": { "$ref": "#/$defs/groupCondition" }, "NOT": { "$ref": "#/$defs/groupCondition" } }, "minProperties": 1, "maxProperties": 1, "additionalProperties": false } ] }, "valueOptions-valueSource": { "properties": { "sourceType": { "description": "Source type for the setting to store and retrieve its value", "enum": [ "GlobalValue", "GameSetting", "INIPrefSetting" ] }, "sourceForm": { "$ref": "#/$defs/form" }, "defaultValue": { "description": "Value used when resetting to default", "anyOf": [ { "type": "boolean" }, { "type": "number" } ] } } }, "action": { "description": "Custom action to execute when the value is changed", "type": "object", "properties": { "type": { "description": "Action type", "enum": [ "RunScript" ] } }, "allOf": [ { "if": { "properties": { "type": { "const": "RunScript" } } }, "then": { "properties": { "path": { "type": "string" } }, "required": ["path"] } } ] } } }