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", "type": "dict",
"default": 42 "flags": ["resize"],
}, "definition": {
"example_3": {
"name": "Example section",
"type": "dict", "type": "dict",
"definition": { "definition": {
"example_4": { "width": {
"name": "Example text", "name": "Width (m)",
"type": "number",
"default": 0.4
},
"target": {
"name": "Tracking target",
"type": "string", "type": "string",
"default": "hello world" "default": "world"
}, },
"example_5": { "fallback": {
"name": "Example Vector3", "name": "Target fallback priority order",
"type": "array",
"default": ["world"]
},
"offsets": {
"name": "Offsets",
"flags": ["resize"],
"type": "dict",
"definition": {
"pos": {
"name": "Offset position",
"type": "vector3", "type": "vector3",
"default": Vector3(1,2,3) "default": Vector3()
}, },
"example_6": { "rot": {
"name": "Example Quat", "name": "Offset rotation",
"type": "quat", "type": "quat",
"default": 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",
"flags": ["resize"],
"definition": {
"type": "dict",
"definition": {
"property1": {
"name": "Property 1",
"type": "number",
"default": 123
},
"property2": {
"name": "Property 2",
"type": "number",
"default": 345
},
} }
} }
}, }
}
} }
var s: Dictionary = {} var s: Dictionary = {}