feat: Implement cycle timer toggle, refactor continuous input, and improve movement synchronization.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user