create settings definition

This commit is contained in:
Crispy 2021-05-23 23:42:59 +02:00
parent ba65c823f1
commit 919319cc83

View file

@ -6,73 +6,55 @@ signal settings_loaded # emitted when settings are loaded from file, needs to be
var DEBUG_SETTINGS = true var DEBUG_SETTINGS = true
var SETTINGS_PATH = "user://settings.json" var SETTINGS_PATH = "user://settings.json"
const SETTINGS_DEF = { const SETTINGS_DEF = {
"example_1": { "grab_mode": {
"name": "Example Toggle", "name": "Grab mode",
"description": "resets every restart", # optional "description": "Grab and drag around any overlay",
"flags": ["no_save"], # optional "flags": ["no_save"],
"type": "bool", "type": "bool",
"default": false "default": false
}, },
"example_2": { "overlays": {
"name": "Example Number", "name": "Settings for all overlays",
"type": "number",
"default": 42
},
"example_3": {
"name": "Example section",
"type": "dict",
"definition": {
"example_4": {
"name": "Example text",
"type": "string",
"default": "hello world"
},
"example_5": {
"name": "Example Vector3",
"type": "vector3",
"default": Vector3(1,2,3)
},
"example_6": {
"name": "Example Quat",
"type": "quat",
"default": Quat()
}
}
},
"example_7": {
"name": "Example array",
"type": "array",
"default": [1,23,4]
},
"example_8": {
"name": "Example dict with varying size containing arrays",
"type": "dict",
"flags": ["resize"],
"definition": {
"type": "array",
"default": [99,45,1]
}
},
"example_9": {
"name": "Example dict with varying size containing more dicts",
"type": "dict", "type": "dict",
"flags": ["resize"], "flags": ["resize"],
"definition": { "definition": {
"type": "dict", "type": "dict",
"definition": { "definition": {
"property1": { "width": {
"name": "Property 1", "name": "Width (m)",
"type": "number", "type": "number",
"default": 123 "default": 0.4
}, },
"property2": { "target": {
"name": "Property 2", "name": "Tracking target",
"type": "number", "type": "string",
"default": 345 "default": "world"
}, },
"fallback": {
"name": "Target fallback priority order",
"type": "array",
"default": ["world"]
},
"offsets": {
"name": "Offsets",
"flags": ["resize"],
"type": "dict",
"definition": {
"pos": {
"name": "Offset position",
"type": "vector3",
"default": Vector3()
},
"rot": {
"name": "Offset rotation",
"type": "quat",
"default": Quat()
}
}
}
} }
} }
}, }
} }
var s: Dictionary = {} var s: Dictionary = {}