summaryrefslogtreecommitdiff
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
parent76712852d30df670741c836a8e705e7482a8a2ac (diff)
downloadhurrycurry-02922819efbe2eb43b58056469df621870bce3e9.tar
hurrycurry-02922819efbe2eb43b58056469df621870bce3e9.tar.bz2
hurrycurry-02922819efbe2eb43b58056469df621870bce3e9.tar.zst
add vibration setting; fixes #199
-rw-r--r--client/player/controllable_player.gd17
-rw-r--r--client/settings.gd7
-rw-r--r--locale/en.ini3
3 files changed, 16 insertions, 11 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),
]),
diff --git a/locale/en.ini b/locale/en.ini
index 0c5fd096..302e70a2 100644
--- a/locale/en.ini
+++ b/locale/en.ini
@@ -86,6 +86,7 @@ c.settings.gameplay.latch_boost=Always extend boost to maximum duration
c.settings.gameplay.setup_completed=Initial setup complete. (Uncheck and restart to reenter)
c.settings.gameplay.tutorial_disabled=Disable tutorial
c.settings.gameplay.usernames=Show username tags
+c.settings.gameplay.vibration=Enable vibrations
c.settings.gameplay=Gameplay
c.settings.graphics.aa.disabled=Disabled
c.settings.graphics.aa.fx=FXAA
@@ -191,10 +192,10 @@ c.setup.uniform.value=Hairstyle {0}
c.setup.uniform=3. [b]Working Uniform.[/b] You must always have one of the following hairstyles.
c.setup.user_signature.desc=Signature of the Employee:%n%n%n
c.setup.user_signature=Click to sign
+s.bot.dishwasher=Dish washer
s.bot.frank=Frank Miller
s.bot.simple=Simple chef
s.bot.waiter=Waiter
-s.bot.dishwasher=Dish washer
s.campaign.condition.stars=Reach at least {0} stars in {1}
s.campaign.list_helper=- {0}%n - {1}
s.campaign.unlock_condition=To unlock: %n%n{0}