fix(client): free camera review fixes — action toggle, zoom reset, discrete guard, tests (#898)
- Replace raw KEY_F4 check with Input.is_action_just_pressed("free_camera") to
consume the registered project action (matches F3/F12 dev toggle pattern)
- Reset camera.zoom to Vector2.ONE when toggling free camera off so zoom does
not bleed into normal gameplay
- Add free_camera_mode guard to InputMapper._unhandled_input() so discrete
actions (INTERACT, stance, pause) are suppressed alongside movement
- Add client/tests/test_free_camera.gd: flag default, movement suppression,
discrete action suppression, zoom constant contracts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -117,6 +117,8 @@ func _process(_delta: float) -> void:
|
||||
|
||||
# Discrete actions: fire once on key press (not held).
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if GameState.dialogue_active or GameState.free_camera_mode:
|
||||
return
|
||||
var action: Action = -1
|
||||
|
||||
if event.is_action_pressed("interact"):
|
||||
|
||||
@@ -210,9 +210,11 @@ func _unhandled_key_input(event: InputEvent) -> void:
|
||||
if not (event is InputEventKey) or not event.is_pressed() or event.is_echo():
|
||||
return
|
||||
var key_event := event as InputEventKey
|
||||
# #898: F4 toggles free camera mode.
|
||||
if key_event.physical_keycode == KEY_F4:
|
||||
# #898: F4 toggles free camera mode. Reset zoom to 1:1 on exit.
|
||||
if Input.is_action_just_pressed("free_camera"):
|
||||
GameState.free_camera_mode = not GameState.free_camera_mode
|
||||
if not GameState.free_camera_mode:
|
||||
camera.zoom = Vector2.ONE
|
||||
return
|
||||
# Registry-driven toggle: each manifest declares its own default_key.
|
||||
for manifest: ImplantAppManifest in ImplantRegistry.get_manifests():
|
||||
|
||||
Reference in New Issue
Block a user