Redesign phone calls with a responsive word cloud and user siren

This commit is contained in:
Codex
2026-10-30 01:38:31 +02:00
parent 6549ba9308
commit 56d9af9d2e
15 changed files with 976 additions and 206 deletions
+90 -2
View File
@@ -64,6 +64,8 @@ func render() -> void:
await RenderingServer.frame_post_draw
func capture(name: String) -> void:
if DisplayServer.get_name() != "headless":
await game.get_tree().create_timer(0.42).timeout
await render()
if DisplayServer.get_name() != "headless":
game.get_viewport().get_texture().get_image().save_png(directory().path_join(name + ".png"))
@@ -96,6 +98,7 @@ func realtime_check() -> void:
check(game.action_button("next") != null, "Production ending overlay")
await capture("phone-real-ending")
click("next")
while game.dialing: await game.get_tree().create_timer(0.1).timeout
await game.get_tree().create_timer(5.0).timeout
check(game.chapter == 2 and game.running, "Production redial")
check("greeting" in game.heard and "call_02_k" in game.heard, "Production second opening")
@@ -146,6 +149,21 @@ func run(target: Node) -> void:
click("settings")
await capture("phone-credits")
click("back_menu")
game.dial_call(1,true,0,true)
check(game.dialing and not game.running, "Dial animation precedes the 90-second clock")
check(game.stage.mother_status.text == "Входящий звонок", "Mother sees incoming daughter call")
await game.get_tree().create_timer(0.55).timeout
await capture("phone-dialing")
await game.get_tree().create_timer(1.9 if DisplayServer.get_name() == "headless" else 1.5).timeout
check(game.running and not game.dialing and game.elapsed < 1.0, "Connection starts a fresh full attempt")
check("greeting" in game.heard, "Mother answers after connection")
game.stage.update(1.0)
check(game.stage.purple_level > game.stage.pink_level, "Mother lights the violet background")
await capture("phone-mother-voice")
at(4.0)
game.stage.update(1.0)
check(game.stage.pink_level > game.stage.purple_level, "Katya lights the pink background")
await capture("phone-katya-voice")
start(2)
var blocked: Button = game.action_button("keys_search")
check(blocked != null and blocked.disabled, "Choices visible but disabled during greeting")
@@ -157,6 +175,67 @@ func run(target: Node) -> void:
check(game.action_button("keys_search").disabled, "Still blocked before audio end")
wait_for_speech()
check(not game.action_button("keys_search").disabled, "Choices enabled after complete opening exchange")
await capture("phone-answer-cloud")
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":
var tag: Button = game.action_button("keys_search")
# Keep the user's physical cursor from cancelling the timed synthetic hover.
# Click dispatch is still checked through the real viewport just below.
game.command_list.mouse_filter=Control.MOUSE_FILTER_IGNORE
await render()
game.command_list.hovered=null
game.command_list.pointer_inside=false
var previous: Vector2 = tag.position
await game.get_tree().create_timer(0.65).timeout
check(tag.position.distance_to(previous)>0.1, "Answer tags drift gently")
var pointer := InputEventMouseMotion.new()
pointer.position = tag.position+tag.size/2
game.command_list._gui_input(pointer)
await game.get_tree().create_timer(0.45).timeout
check(tag.scale.x>1.08, "Hovered answer grows")
var held: Vector2 = tag.position
await game.get_tree().create_timer(0.25).timeout
check(tag.position.distance_to(held)<0.1, "Hovered answer holds still for clicking")
await capture("phone-answer-hover")
pointer = InputEventMouseMotion.new()
pointer.position = Vector2(-20,-20)
game.command_list._gui_input(pointer)
await game.get_tree().create_timer(0.5).timeout
check(tag.scale.x<1.08, "Answer returns to its depth after hover")
game.command_list.mouse_filter=Control.MOUSE_FILTER_STOP
await render()
var press := InputEventMouseButton.new()
press.button_index=MOUSE_BUTTON_LEFT
press.position=tag.get_global_rect().get_center()
press.pressed=true
game.get_viewport().push_input(press,true)
var release := InputEventMouseButton.new()
release.button_index=MOUSE_BUTTON_LEFT
release.position=press.position
release.pressed=false
game.get_viewport().push_input(release,true)
check(game.busy.get("id","")=="keys_search", "Mouse selects the visible floating answer")
start(2)
wait_for_speech()
await render()
check(game.stage.memory_button.size.x >= 100 and game.stage.menu_button.size.x >= 80, "Header controls stay readable")
if DisplayServer.get_name() != "headless":
var original_size := DisplayServer.window_get_size()
DisplayServer.window_set_size(Vector2i(1366,768))
await capture("phone-wide-layout")
check(game.ui.get_global_rect().encloses(game.stage.mother_phone.get_global_rect()), "Mother phone fits wide viewport")
check(game.ui.get_global_rect().encloses(game.stage.smartphone.get_global_rect()), "Katya phone fits wide viewport")
DisplayServer.window_set_size(original_size)
await render()
var cloud_rect: Rect2 = game.stage.choice_scroll.get_global_rect()
check(cloud_rect.position.y > game.transcript_scroll.get_global_rect().position.y, "Answers below central dialogue")
for child in game.command_list.get_children():
if child is Button:
check(child.get_global_rect().position.x >= cloud_rect.position.x and child.get_global_rect().end.x <= cloud_rect.end.x + 1, "Answer fits cloud width: " + child.text)
click("memory")
check(game.action_button("close_memory") != null, "Notebook opens from call screen")
click("close_memory")
click("keys_search")
check(game.cancel_button.disabled, "Cancellation cannot interrupt the spoken request")
game.cancel_task()
@@ -198,6 +277,11 @@ func run(target: Node) -> void:
check(not game.fired.has("alarm"), "No early siren: " + str(number))
at(24.01)
check(game.fired.get("alarm") == 24.0, "Same siren time: " + str(number))
check(game.siren.playing and game.siren.volume_db < -60, "Siren starts softly: " + str(number))
at(27)
check(game.siren.volume_db > -40 and game.siren.volume_db < -25, "Siren rises gradually: " + str(number))
at(30)
check(absf(game.siren.volume_db+23)<0.1, "Siren reaches quiet background level: " + str(number))
at(44.99)
check(not game.fired.has("power") and "темно" not in game.place_label.text, "Lights stay on until 45: " + str(number))
at(45.01)
@@ -229,7 +313,7 @@ func run(target: Node) -> void:
check(game.heard == ["greeting"], "Identical opening " + str(number))
if number == 1:
check(game.action_button("keys_search") == null, "Prologue has no commands")
check(game.clock_label.text == "Разговор", "Prologue hides time")
check(game.clock_label.text.is_empty(), "Prologue hides time")
for beat in game.story.intro: at(beat.at + 0.01)
check(game.heard.size() == 19 and "power" in game.heard, "Ordinary conversation and blackout acknowledgement")
else:
@@ -370,6 +454,9 @@ func run(target: Node) -> void:
at(17)
check(game.notifications.size() == 1 and game.unread == 1, "First push at 17 seconds")
check(game.notification_card.visible, "Push is visible")
await render()
if DisplayServer.get_name() != "headless":
check(game.stage.smartphone.display.get_global_rect().encloses(game.notification_card.get_global_rect()), "Push stays on Katya's smartphone")
click("dismiss_push")
check(not game.notification_card.visible and game.unread == 1, "Dismiss keeps message unread")
click("keys_search")
@@ -396,7 +483,8 @@ func run(target: Node) -> void:
check(game.notifications.size() == 5 and game.notification_card.visible, "Fifth push over ending screen")
check(game.notifications[4].text == "Кать в твой дом походу попали...", "Exact fifth text")
await capture("phone-after-impact-push")
check(game.notification_card.size.y < 300, "Toast stays compact across all five pushes")
if DisplayServer.get_name() != "headless":
check(game.notification_card.size.y < 300, "Toast stays compact across all five pushes")
click("open_push")
check(game.viewing_messages and game.notifications.size() == 5, "All messages readable after impact")
await capture("phone-inbox")