Fields - Levrault/Godot-3-Pixel-Art-Menu-Template GitHub Wiki

Fields are made to be used with

  • An Updater, required for every field, won't works without it
  • An Filter, optional

Hlist

A horizontal carousel. Display the selected saved data, save on change.

hlist.png

;hlist
hlist = {
    "default": "option_1",
    "options": [ {
        "key": "option_1",
        "translation_key": "cfg.option_1",
        "properties": {
            "value": true
        }
    }, {
        "key": "option_2",
        "translation_key": "cfg.option_2",
        "properties": {
            "value": false
        }
    } ]
}

Slider

Should be use to manage float and int value, auto-save with a debounce of 250ms.

slider.png

;slider
slider = {
 "default": 0,
 "properties": {
 "value": 0
 }
}

Dropdown

A simple dropdown list. Should be used for actions that have a direct impact on the visual.

  • Can be used with a confirmation popup (with an updater) for fields like resolution, window mode
  • Can be used without a confirmation popup like change the UI's language

dropdown.png

;dropdown
dropdown = {
    "default": "option_1",
    "options": [{
        "key": "option_1", 
        "translation_key": "cfg.option_1",
        "properties": {
            "test": "option",
        }
    }, {
        "key": "option_2", 
        "translation_key": "cfg.option_2",
        "properties": {
            "test": "option",
        }
    }]
}

Checkbox

Manage boolean value. Use constant string checked and unchecked

checkbox.png

;checkbox
checkbox = {
    "default": "checked",
    "checked": {
        "key": true,
        "properties": { 
            "value": true
        }
    },
    "unchecked": {
        "key": false,
        "properties": { 
            "value": false
        }
    }
}