aboutsummaryrefslogtreecommitdiff
path: root/client/global.gd
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2024-06-29 20:40:44 +0200
committertpart <tpart120@proton.me>2024-06-29 20:40:48 +0200
commit3fb89fbdaa05e411409f3107b856bd645fc0b58a (patch)
tree851a8a0dd893047487592e44bcd781e887fc6bac /client/global.gd
parent1e563554a11d063f67ad98bcbf75aa11a9729eb5 (diff)
downloadhurrycurry-3fb89fbdaa05e411409f3107b856bd645fc0b58a.tar
hurrycurry-3fb89fbdaa05e411409f3107b856bd645fc0b58a.tar.bz2
hurrycurry-3fb89fbdaa05e411409f3107b856bd645fc0b58a.tar.zst
Add grass amount setting; Fix bug in add missing keys function
Diffstat (limited to 'client/global.gd')
-rw-r--r--client/global.gd12
1 files changed, 10 insertions, 2 deletions
diff --git a/client/global.gd b/client/global.gd
index 35244fa7..b70f4894 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")
}
}
@@ -143,7 +151,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])