summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-09-29 23:17:41 +0200
committermetamuffin <metamuffin@disroot.org>2024-09-29 23:17:41 +0200
commit02922819efbe2eb43b58056469df621870bce3e9 (patch)
tree329549b95f9caf0a403bd00ea5853d10ce8ff828 /client
parent76712852d30df670741c836a8e705e7482a8a2ac (diff)
downloadhurrycurry-02922819efbe2eb43b58056469df621870bce3e9.tar
hurrycurry-02922819efbe2eb43b58056469df621870bce3e9.tar.bz2
hurrycurry-02922819efbe2eb43b58056469df621870bce3e9.tar.zst
add vibration setting; fixes #199
Diffstat (limited to 'client')
-rw-r--r--client/player/controllable_player.gd17
-rw-r--r--client/settings.gd7
2 files changed, 14 insertions, 10 deletions
diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd
index f0d573c8..58d3d1e6 100644
--- a/client/player/controllable_player.gd
+++ b/client/player/controllable_player.gd
@@ -100,7 +100,7 @@ func _process_movement(delta):
var was_boosting = boosting
direction = input
update(delta, boost)
- if boosting and not was_boosting:
+ if boosting and not was_boosting and Global.get_setting("gameplay.vibration"):
Input.start_joy_vibration(0, 0, input.length(), 0.15)
Input.vibrate_handheld(75, input.length() * 0.1)
walking = input.length_squared() > 0.1
@@ -172,8 +172,9 @@ func progress(position__: float, speed: float, warn: bool):
current_vibration_strength = position__
current_vibration_change = speed
var vibration_strength := pow(current_vibration_strength, 3)
- Input.start_joy_vibration(0, vibration_strength, 0, 0.1)
- Input.vibrate_handheld(100, vibration_strength)
+ if Global.get_setting("gameplay.vibration"): # todo maybe include the lines above too
+ Input.start_joy_vibration(0, vibration_strength, 0, 0.1)
+ Input.vibrate_handheld(100, vibration_strength)
vibration_timer.start()
if speed == 0:
current_vibration_strength = 0.
@@ -190,13 +191,15 @@ func _on_vibration_timeout():
func put_item(tile: Tile):
super(tile)
- Input.start_joy_vibration(0, 0.1, 0.0, 0.075)
- Input.vibrate_handheld(75, 0.1)
+ if Global.get_setting("gameplay.vibration"):
+ Input.start_joy_vibration(0, 0.1, 0.0, 0.075)
+ Input.vibrate_handheld(75, 0.1)
func take_item(tile: Tile):
super(tile)
- Input.start_joy_vibration(0, 0.1, 0.0, 0.075)
- Input.vibrate_handheld(75, 0.1)
+ if Global.get_setting("gameplay.vibration"):
+ Input.start_joy_vibration(0, 0.1, 0.0, 0.075)
+ Input.vibrate_handheld(75, 0.1)
func interact():
if not is_input_enabled(): return
diff --git a/client/settings.gd b/client/settings.gd
index eddc5207..e50ce90c 100644
--- a/client/settings.gd
+++ b/client/settings.gd
@@ -21,13 +21,14 @@ class_name Settings
static func get_root():
return SettingsRoot.new([
SettingsCategory.new("gameplay", [
- ToggleSetting.new("interpolate_camera_rotation", false),
- ToggleSetting.new("invert_camera", false),
ToggleSetting.new("usernames", true),
+ ToggleSetting.new("latch_boost", true),
+ ToggleSetting.new("vibration", true),
+ ToggleSetting.new("invert_camera", false),
+ ToggleSetting.new("interpolate_camera_rotation", false),
ToggleSetting.new("setup_completed", false),
ToggleSetting.new("tutorial_disabled", false),
ToggleSetting.new("hints_started", false),
- ToggleSetting.new("latch_boost", true),
ToggleSetting.new("accessible_movement", false),
ToggleSetting.new("first_person", false),
]),