diff --git a/scripts/ui/ccs_player.gd b/scripts/ui/ccs_player.gd index 0e6990c..d818143 100644 --- a/scripts/ui/ccs_player.gd +++ b/scripts/ui/ccs_player.gd @@ -435,6 +435,7 @@ func on_show(payload: Variant = null) -> void: func on_hide() -> void: timer.stop() + opening_active = false _dismiss_dialogs() @@ -458,6 +459,12 @@ func _ccs_dialogs() -> Array[Window]: func _render() -> void: + # This screen stays subscribed to the shared CCS attempt while hidden. + # Never allow its Window-based dialogs to appear over CCS Cases 2. + if not visible: + opening_active = false + _dismiss_dialogs() + return var attempt: Dictionary = CCSService.attempt if attempt.is_empty(): return diff --git a/tests/ccs_player_test.gd b/tests/ccs_player_test.gd index 03a4bdc..3b2e784 100644 --- a/tests/ccs_player_test.gd +++ b/tests/ccs_player_test.gd @@ -66,7 +66,15 @@ func _run() -> void: _assert(player.time_dialog.visible, "CCS dialog lifecycle test should begin with an open popup") player.on_hide() _assert(not player.time_dialog.visible, "hiding the CCS screen should dismiss popup windows") + player.visible = false + ccs_service.attempt.openingCompleted = false + player._render() + await process_frame + _assert(not player.intro_dialog.visible, "a hidden classic player must not open dialogs over CCS Cases 2") + _assert(not player.opening_active, "a hidden classic player must not begin its opening sequence") + player.visible = true + ccs_service.attempt.openingCompleted = true ccs_service.attempt.state = "final_orders" player._render() _assert(player.final_orders_notice.visible, "final-orders mode should show instructions")