diff options
Diffstat (limited to 'client/player/controllable_player.gd')
-rw-r--r-- | client/player/controllable_player.gd | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd index 3bcfacff..1700d900 100644 --- a/client/player/controllable_player.gd +++ b/client/player/controllable_player.gd @@ -73,7 +73,7 @@ var moving_duration = 0 var fps_rotation_target = 0 func _process_movement(delta): var input = Input.get_vector("left", "right", "forwards", "backwards") if is_input_enabled() else Vector2.ZERO - if Global.get_setting("gameplay.first_person"): + if Settings.read("gameplay.first_person"): fps_rotation_target += input.x * delta * 3. if abs(input.x) > 0.1: input.y -= 0.5 input.x = 0. @@ -82,14 +82,14 @@ func _process_movement(delta): else: input = input.rotated(input_rotation) - var boost = Input.is_action_pressed("boost") or (Global.get_setting("gameplay.latch_boost") and boosting) + var boost = Input.is_action_pressed("boost") or (Settings.read("gameplay.latch_boost") and boosting) if Input.is_action_pressed("interact_left") or Input.is_action_just_released("interact_left") or Input.is_action_pressed("interact_right") or Input.is_action_just_released("interact_right"): input *= 0 else: update_interact_target() - if Global.get_setting("gameplay.accessible_movement"): + if Settings.read("gameplay.accessible_movement"): if input.length() < 0.5: moving_duration -= delta * 2 else: moving_duration += delta moving_duration = clamp(moving_duration, 0, 1) @@ -99,7 +99,7 @@ func _process_movement(delta): var was_boosting = boosting direction = input update(delta, boost) - if boosting and not was_boosting and Global.get_setting("gameplay.vibration"): + if boosting and not was_boosting and Settings.read("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 @@ -171,7 +171,7 @@ func progress(position__: float, speed: float, warn: bool, h): current_vibration_strength = position__ current_vibration_change = speed var vibration_strength := pow(current_vibration_strength, 3) - if Global.get_setting("gameplay.vibration"): # todo maybe include the lines above too + if Settings.read("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() @@ -190,13 +190,13 @@ func _on_vibration_timeout(): func put_item(tile: Tile, h: int): super(tile, h) - if Global.get_setting("gameplay.vibration"): + if Settings.read("gameplay.vibration"): Input.start_joy_vibration(0, 0.1, 0.0, 0.075) Input.vibrate_handheld(75, 0.1) func take_item(tile: Tile, h: int): super(tile, h) - if Global.get_setting("gameplay.vibration"): + if Settings.read("gameplay.vibration"): Input.start_joy_vibration(0, 0.1, 0.0, 0.075) Input.vibrate_handheld(75, 0.1) @@ -229,7 +229,7 @@ func interact(): marker.visible = false func update_interact_target(): - match Global.get_setting("gameplay.interact_target"): + match Settings.read("gameplay.interact_target"): "dirsnap": return update_interact_target_dirsnap() "dir": return update_interact_target_dir() _: return update_interact_target_dir() |