diff options
Diffstat (limited to 'client/global.gd')
-rw-r--r-- | client/global.gd | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/client/global.gd b/client/global.gd index 35244fa7..da1d8515 100644 --- a/client/global.gd +++ b/client/global.gd @@ -18,10 +18,11 @@ extends Node # Each setting contains a dictionary with the following keys: -# "type": The type of the setting. Can be "toggle", "line", "dropdown", or "dropdown_preset" +# "type": The type of the setting. Can be "toggle", "line", "range", "dropdown", or "dropdown_preset" # "value": The value of the setting. When using "dropdown", this contains an int # as the index for the respecitve element in the "options" array. # "apply": Only for type "dropdown_preset": A dictionary to override all other settings. +# "min" and "max": Only for type "range": The min and max values. # "description": The setting name displayed in the settings menu. # (Optional: Only when type = "dropdown") "options": An array which contains all # possible values. @@ -64,6 +65,13 @@ var default_settings := { "type": "toggle", "value": false, "description": tr("Use SDFGI (Doesn't block the game but is more resource-hungry)") + }, + "grass_amount": { + "type": "range", + "value": 16, + "min": 0, + "max": 32, + "description": tr("3D grass amount per grass tile") } } @@ -71,22 +79,26 @@ const GRAPHICS_PRESETS = [ # Low: { "voxel_gi": false, - "sdfgi": false + "sdfgi": false, + "grass_amount": 0 }, # Medium: { "voxel_gi": false, - "sdfgi": false + "sdfgi": false, + "grass_amount": 16 }, # High: { "voxel_gi": false, - "sdfgi": true + "sdfgi": true, + "grass_amount": 16 }, # Ultra: { "voxel_gi": true, - "sdfgi": false + "sdfgi": false, + "grass_amount": 24 } ] @@ -143,7 +155,7 @@ func focus_first_button(node: Node) -> bool: func add_missing_keys(dict: Dictionary, reference: Dictionary): for k in reference.keys(): if !dict.has(k): - dict[k] = reference + dict[k] = reference[k] else: if dict[k] is Dictionary: add_missing_keys(dict[k], reference[k]) |