aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-21 09:48:52 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-21 09:48:52 +0200
commitbf306ec89a9ba41f788008b833a9df470c2e37e5 (patch)
treeac04adf099be62096338cc600f455c6ba14acd79
parent15c0d3f4236d43c43178f4cc1fc32171ebb732f7 (diff)
parent99501cdc66733768a653280cea4059227f893f06 (diff)
downloadhurrycurry-bf306ec89a9ba41f788008b833a9df470c2e37e5.tar
hurrycurry-bf306ec89a9ba41f788008b833a9df470c2e37e5.tar.bz2
hurrycurry-bf306ec89a9ba41f788008b833a9df470c2e37e5.tar.zst
Merge branch 'master' of https://codeberg.org/hurrycurry/hurrycurry
-rw-r--r--client/menu/setup.gd6
-rw-r--r--client/player/follow_camera.gd7
2 files changed, 8 insertions, 5 deletions
diff --git a/client/menu/setup.gd b/client/menu/setup.gd
index 470b0839..6c3c90cd 100644
--- a/client/menu/setup.gd
+++ b/client/menu/setup.gd
@@ -52,10 +52,10 @@ func _process(delta):
func check():
- if username.text == "": return "Username cannot be empty"
+ if username.text == "": return tr("Username cannot be empty")
var n = username.text.to_lower()
- if n.begins_with("f") and n.ends_with("miller"): return "You cannot choose that name.\n(It's too close to your boss')"
- if character == -1: return "You must select a hairstyle"
+ if n.begins_with("f") and n.ends_with("miller"): return tr("You cannot choose that name.\n(It's too close to your boss')")
+ if character == -1: return tr("You must select a hairstyle")
return null
func _on_sign_pressed():
diff --git a/client/player/follow_camera.gd b/client/player/follow_camera.gd
index 5440f8b1..3c993ee0 100644
--- a/client/player/follow_camera.gd
+++ b/client/player/follow_camera.gd
@@ -2,6 +2,7 @@
# Copyright 2024 nokoe
# Copyright 2024 tpart
# Copyright 2024 metamuffin
+# Copyright 2024 BigBrotherNii
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -31,6 +32,7 @@ const ZOOM_SPEED_DISCRETE: float = 1.0
const ZOOM_WEIGHT: float = 10.0
const MAX_ZOOM: float = 20.0
const MIN_ZOOM: float = 2.0
+const ZOOM_CURRENT_TO_MAX_RATIO: float = 1.35
@export var target: Node3D
@@ -90,10 +92,11 @@ func follow(delta):
camera_distance_target += Input.get_axis("zoom_in", "zoom_out") * ZOOM_SPEED * delta
+ # (ZOOM_CURRENT_TO_MAX_RATIO * camera_distance_target / MAX_ZOOM) simulates the exponential zooming for the mouse
if Input.is_action_just_pressed("zoom_in_discrete"):
- camera_distance_target -= ZOOM_SPEED_DISCRETE
+ camera_distance_target -= ZOOM_SPEED_DISCRETE * (ZOOM_CURRENT_TO_MAX_RATIO * camera_distance_target / MAX_ZOOM)
elif Input.is_action_just_pressed("zoom_out_discrete"):
- camera_distance_target += ZOOM_SPEED_DISCRETE
+ camera_distance_target += ZOOM_SPEED_DISCRETE * (ZOOM_CURRENT_TO_MAX_RATIO * camera_distance_target / MAX_ZOOM)
camera_distance_target = clamp(camera_distance_target, MIN_ZOOM, MAX_ZOOM)