Polish phone typography and add black-screen redial epilogue

This commit is contained in:
Codex
2026-10-30 13:11:25 +02:00
parent aa45c6c0bd
commit c60ba40e9b
14 changed files with 389 additions and 57 deletions
+116 -12
View File
@@ -95,8 +95,98 @@ func finish(expected: String) -> void:
check(not game.voice.playing, "Strike cuts dialogue")
check(game.outcome == expected, "Expected " + expected + ", got " + game.outcome)
results.append({"chapter": game.chapter, "outcome": game.outcome, "facts": game.facts.keys()})
# Fast route checks skip the production epilogue; separate checks below
# wait for the real audio and verify that it gates the redial control.
game.ending_ready = true
game.show_ending()
func check_black_frame(context: String) -> void:
await render()
check(not game.stage.call_layout.visible and game.screen_fade.color == Color.BLACK, "Black call stage: " + context)
check(game.action_button("next") == null, "No early redial: " + context)
if DisplayServer.get_name() != "headless":
var frame := game.get_viewport().get_texture().get_image()
frame.resize(32,20,Image.INTERPOLATE_NEAREST)
var black := true
for y in range(frame.get_height()):
for x in range(frame.get_width()):
var pixel := frame.get_pixel(x,y)
if pixel.r > 0.005 or pixel.g > 0.005 or pixel.b > 0.005: black = false
check(black,"Rendered screen is entirely black: " + context)
func production_ending_check(connected: bool = false) -> void:
start(10 if connected else 2,2 if connected else 0)
if connected:
for id in ["keys_fast","lamp_fast","safe","front","side_open","phone_shelf"]: perform(id)
game.qa_mode = false
at(90.1)
await check_black_frame("impact")
game.continue_call()
check(game.impacted and not game.dialing,"Direct redial is blocked during the epilogue")
await game.get_tree().create_timer(2.15).timeout
check(game.voice.playing and game.heard[-1] == ("after_alive" if connected else "after_call"),"Production epilogue starts after the impact")
check(game.notifications.size() == 5 and not game.notification_card.visible,"Fifth message is kept without covering the black screen")
await check_black_frame("voice")
if not connected: await capture("phone-black-voice")
for step in range(100):
if game.ending_ready: break
check(game.action_button("next") == null,"Redial waits for the complete epilogue")
await game.get_tree().create_timer(0.1).timeout
check(game.ending_ready and not game.voice.playing,"Epilogue finishes naturally before redial")
check(game.heard[-1] == ("here" if connected else "after_call"),"Katya has the final spoken line")
await render()
var redial: Button = game.action_button("next")
check(redial != null and redial.text == "Позвонить Маме","Single floating redial label")
if redial != null:
check(redial.get_global_rect().get_center().distance_to(game.ui.get_global_rect().get_center()) < 15,"Redial is centered in the viewport")
check(redial.get_parent().get_child_count() == 1,"Only one tag after the epilogue")
await capture("phone-redial-connected" if connected else "phone-redial")
await escape()
click("ending_messages")
check(game.viewing_messages and game.notifications.size() == 5,"All five messages remain readable from the menu")
await capture("phone-inbox")
click("close_messages")
click("outcome")
check(game.menu_screen == "outcome","Outcome remains available in the menu")
click("transcript")
check(game.archive[-1].speaker == "Катя","Final Katya line remains in the transcript")
click("back_ending")
click("end_menu")
click("resume")
await render()
redial = game.action_button("next")
if redial != null and DisplayServer.get_name() != "headless":
var cloud: Container = redial.get_parent()
cloud.mouse_filter = Control.MOUSE_FILTER_IGNORE
cloud.pointer_inside = false
cloud.hovered = null
await render()
var previous: Vector2 = redial.position
await game.get_tree().create_timer(0.6).timeout
check(redial.position.distance_to(previous)>0.05,"Redial tag drifts slowly")
var pointer := InputEventMouseMotion.new()
pointer.position = redial.position+redial.size/2
cloud._gui_input(pointer)
await game.get_tree().create_timer(0.4).timeout
check(redial.scale.x>1.1,"Redial tag grows on hover")
cloud.mouse_filter = Control.MOUSE_FILTER_STOP
await render()
var press := InputEventMouseButton.new()
press.button_index = MOUSE_BUTTON_LEFT
press.position = redial.get_global_rect().get_center()
press.pressed = true
game.get_viewport().push_input(press,true)
press = press.duplicate()
press.pressed = false
game.get_viewport().push_input(press,true)
else:
click("next")
check(game.dialing and not game.impacted,"Redial starts via the displayed tag")
await game.get_tree().create_timer(2.5).timeout
check(game.running and game.stage.call_layout.visible and game.screen_fade.color.a == 0,"Redial restores both phones and clears blackout")
check(game.notifications.is_empty() and not game.ending_ready,"New call clears epilogue state")
game.qa_mode = true
func realtime_check() -> void:
# Opt-in, genuinely wait for the complete prologue and production transition.
start(1)
@@ -167,6 +257,7 @@ func realtime_final_check() -> void:
func run(target: Node) -> void:
game = target
DirAccess.make_dir_recursive_absolute(directory())
check(game.UI_FONT.get_string_size("Позвонить Маме",0,-1,34).x > game.UI_FONT.base_font.get_string_size("Позвонить Маме",0,-1,34).x,"Cyrillic uses the bold variation rather than the regular fallback")
check(game.story.chapters.size() == 10, "Ten chapters")
check(game.story.lines.size() == 110, "All 110 spoken lines")
for id in game.story.lines:
@@ -237,6 +328,8 @@ func run(target: Node) -> void:
wait_for_speech()
check(not game.action_button("keys_search").disabled, "Choices enabled after complete opening exchange")
await capture("phone-answer-cloud")
check(absf(game.stage.center_region.get_global_rect().get_center().x-game.ui.size.x/2)<1,"Dialogue and answers share the screen center")
check(absf(game.stage.smartphone.get_global_rect().get_center().y-game.stage.mother_phone.get_global_rect().get_center().y)<2,"Phones have the same vertical center")
for answer in game.command_list.get_children():
if answer is Button: check(not answer.text.ends_with(" с"), "Answer has no duration: " + answer.text)
if DisplayServer.get_name() != "headless":
@@ -588,39 +681,50 @@ func run(target: Node) -> void:
check(game.notifications.size() == 4, "Fifth push waits until after impact")
game.show_ending()
at(92)
check(game.notifications.size() == 5 and game.notification_card.visible, "Fifth push over ending screen")
check(game.notifications.size() == 5 and not game.notification_card.visible, "Fifth message arrives while screen stays black")
check(game.notifications[4].text == "Кать в твой дом походу попали...", "Exact fifth text")
await capture("phone-after-impact-push")
if DisplayServer.get_name() != "headless":
check(game.notification_card.size.y < 300, "Toast stays compact across all five pushes")
click("open_push")
game.ending_ready = true
game.show_menu()
click("ending_messages")
check(game.viewing_messages and game.notifications.size() == 5, "All messages readable after impact")
await capture("phone-inbox")
at(96)
check(game.notifications.size() == 5, "No duplicate messages")
click("close_messages")
click("resume")
click("next")
check(game.notifications.is_empty() and game.unread == 0 and not game.notification_card.visible, "Redial resets message history")
# Use the production delayed transition once: a reader who opens the final
# push must not have the inbox closed by the ending coroutine a moment later.
await production_ending_check()
await production_ending_check(true)
# Opening message history during the epilogue does not get closed by audio.
start(2)
game.qa_mode = false
at(90)
await game.get_tree().create_timer(2.2).timeout
check(game.notifications.size() == 5 and game.notification_card.visible, "Production post-impact push arrives")
click("open_push")
await game.get_tree().create_timer(8.0).timeout
check(game.viewing_messages and game.action_button("close_messages") != null, "Ending transition preserves open inbox")
game.show_menu()
await render()
click("ending_messages")
await render()
check(game.menu_screen == "messages" and game.viewing_messages,"Production inbox opens during the final voice")
for frame in range(32):
await game.get_tree().create_timer(0.25).timeout
if game.menu_screen != "messages":
print("PHONE_INBOX_CHANGED menu=",game.menu_screen," running=",game.running," chapter=",game.chapter," ready=",game.ending_ready," heard=",game.heard[-1])
break
check(game.viewing_messages and game.action_button("close_messages") != null, "Ending transition preserves open inbox: " + game.menu_screen)
click("close_messages")
click("resume")
check(game.action_button("next") != null, "Inbox returns to production ending")
game.qa_mode = true
start(2)
await render()
await escape()
check(game.menu_screen == "main","Menu opens before the production impact")
game.qa_mode = false
at(90.1)
await game.get_tree().create_timer(9.0).timeout
check(game.impacted and game.menu_screen == "main", "Impact and ending transition preserve the open menu")
check(game.action_button("resume").text == "Итоги звонка", "Menu updates its return action after disconnect")
check(game.action_button("resume").text == "Вернуться", "Menu updates its return action after disconnect")
click("resume")
check(game.menu_screen.is_empty() and game.action_button("next") != null, "Menu returns to the completed call outcome")
game.qa_mode = true