Lots of little tweaks and fixes
This commit is contained in:
@@ -42,7 +42,15 @@ var _freeTimer:float = 0.0
|
||||
var _mouseDelta:Vector2 = Vector2.ZERO
|
||||
var _rightMouseHeld:bool = false
|
||||
|
||||
func _canOrbit() -> bool:
|
||||
return not UI.activeConversation
|
||||
|
||||
func _input(event:InputEvent) -> void:
|
||||
if not _canOrbit():
|
||||
if _rightMouseHeld:
|
||||
_rightMouseHeld = false
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
return
|
||||
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_RIGHT:
|
||||
_rightMouseHeld = event.pressed
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED if _rightMouseHeld else Input.MOUSE_MODE_VISIBLE
|
||||
@@ -56,13 +64,17 @@ func _process(delta:float) -> void:
|
||||
var xMult:float = -1.0 if SETTINGS.invertCameraX else 1.0
|
||||
var yMult:float = 1.0 if SETTINGS.invertCameraY else -1.0
|
||||
|
||||
var orbitInput:Vector2 = Input.get_vector(
|
||||
"camera_orbit_left", "camera_orbit_right",
|
||||
"camera_orbit_up", "camera_orbit_down"
|
||||
)
|
||||
var orbitInput:Vector2 = Vector2.ZERO
|
||||
var mouseActive:bool = false
|
||||
|
||||
if _canOrbit():
|
||||
orbitInput = Input.get_vector(
|
||||
"camera_orbit_left", "camera_orbit_right",
|
||||
"camera_orbit_up", "camera_orbit_down"
|
||||
)
|
||||
mouseActive = _mouseDelta.length_squared() > 0.0
|
||||
|
||||
var controllerActive:bool = orbitInput.length() > 0.01
|
||||
var mouseActive:bool = _mouseDelta.length_squared() > 0.0
|
||||
|
||||
# Any manual camera input returns to FREE and resets the centering timer
|
||||
if controllerActive or mouseActive:
|
||||
@@ -83,10 +95,10 @@ func _process(delta:float) -> void:
|
||||
if mouseActive:
|
||||
_yaw += _mouseDelta.x * mouseSensitivity * SETTINGS.cameraSpeedMouse * xMult
|
||||
_pitch += _mouseDelta.y * mouseSensitivity * SETTINGS.cameraSpeedMouse * yMult
|
||||
_mouseDelta = Vector2.ZERO
|
||||
_mouseDelta = Vector2.ZERO
|
||||
|
||||
# center_camera input → switch to MANUAL_CENTER immediately
|
||||
if Input.is_action_just_pressed("center_camera"):
|
||||
if _canOrbit() and Input.is_action_just_pressed("center_camera"):
|
||||
_mode = CameraMode.MANUAL_CENTER
|
||||
|
||||
# In FREE mode, accumulate time toward auto-centering while the player is moving
|
||||
|
||||
Reference in New Issue
Block a user