feat: Implement cycle timer toggle, refactor continuous input, and improve movement synchronization.

This commit is contained in:
2026-01-07 05:41:38 +08:00
parent 251b677a2e
commit 6aede0a382
11 changed files with 210 additions and 58 deletions
+17
View File
@@ -38,6 +38,13 @@ func _ready():
func initialize(main: Node):
main_scene = main
if LobbyManager:
LobbyManager.enable_cycle_timer_changed.connect(_on_enable_cycle_timer_changed)
func _on_enable_cycle_timer_changed(enabled: bool):
# If disabled mid-cycle, the timer will just freeze in _process
# If enabled mid-cycle, it will resume
pass
func _process(delta):
# Update global match timer if active
@@ -57,6 +64,16 @@ func _process(delta):
# Update cycle timer if cycle is active
if not is_cycle_active:
return
# Skip countdown if timer is disabled
var lobby_manager = get_tree().get_root().get_node_or_null("Main/LobbyManager")
# Note: LobbyManager is an Autoload, so we can access it directly via 'LobbyManager'
if LobbyManager and not LobbyManager.get_enable_cycle_timer():
# If timer is disabled, we just don't decrement.
# But we still keep is_cycle_active = true so the phase is "active" (allowing actions)
# just without the clock ticking down.
return
current_cycle_timer -= delta