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
@@ -7,6 +7,7 @@ var velocity := Vector2(0.065,0.018)
var pointer := Vector2.ZERO
var pointer_inside := false
var pressed_tag: Control
var centered_single := false
func _ready() -> void:
mouse_filter=Control.MOUSE_FILTER_STOP
@@ -96,6 +97,10 @@ func _process(delta: float) -> void:
var depth := (point.z+1)/2
var scale_factor := 0.68+depth*0.37
var target := cloud_origin+Vector2(point.x*radius.x,point.y*radius.y)*scale_factor
if centered_single and tags.size() == 1:
target = size/2+Vector2(sin(yaw)*10,sin(pitch)*6)
scale_factor = 1.0
depth = 1.0
if child==active:
if not child.get_meta("cloud_active",false): child.set_meta("cloud_hold",child.position+child.size/2)
target=child.get_meta("cloud_hold")
+2 -1
View File
@@ -1,4 +1,5 @@
extends Control
const UI_FONT = preload("res://assets/fonts/Arimo-Bold.tres")
## Vector phone shells. Screens are ordinary controls, so notifications stay clickable.
var smartphone := true
var dialing := false
@@ -26,7 +27,7 @@ func rounded(rect: Rect2, color: Color, border: Color, radius: int, width: int =
draw_style_box(box, rect)
func text_at(at: Vector2, text: String, font_size: int, color: Color) -> void:
var font := ThemeDB.fallback_font
var font: Font = UI_FONT
var width := font.get_string_size(text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x
draw_string(font, at - Vector2(width / 2, 0), text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color)
+71 -22
View File
@@ -3,6 +3,7 @@ extends Node3D
const Profile = preload("res://scripts/profile.gd")
const Soundscape = preload("res://scripts/phone_soundscape.gd")
const PhoneStage = preload("res://scripts/phone_stage.gd")
const UI_FONT = preload("res://assets/fonts/Arimo-Bold.tres")
const SAVE_PATH := "user://profile/phone_memory.cfg"
const BG := Color("0b0a12")
const CARD := Color("1c1826")
@@ -21,6 +22,7 @@ var test_mode := false
var qa_mode := false
var running := false
var impacted := false
var ending_ready := false
var elapsed := 0.0
var start_tick := 0
var place := "flat"
@@ -153,7 +155,10 @@ func make_ui() -> void:
ui = Control.new()
ui.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
var theme := Theme.new()
theme.default_font = UI_FONT
theme.default_font_size = 19
for font_type in ["normal_font", "bold_font", "italics_font", "bold_italics_font", "mono_font"]:
theme.set_font(font_type,"RichTextLabel",UI_FONT)
ui.theme = theme
layer.add_child(ui)
stage = PhoneStage.new()
@@ -180,13 +185,13 @@ func close_overlay() -> void:
func show_messages() -> void:
close_overlay()
var box: VBoxContainer = menu_page("messages") if impacted else stage.inbox()
viewing_messages = true
unread = 0
notification_card.visible = false
var box: VBoxContainer = stage.inbox()
var back := button("‹ " + str(story.friend), "close_messages", func():
close_overlay()
if impacted: show_ending())
if impacted: show_menu()
else: close_overlay())
back.add_theme_font_size_override("font_size",18)
box.add_child(back)
box.add_child(label("Мама · звонок продолжается" if running else "После звонка",12,ACCENT))
@@ -226,10 +231,10 @@ func update_notifications(second: float) -> void:
notifications.append(entry.duplicate())
notification_cursor += 1
unread += 1
notification_sound.play()
if not impacted: notification_sound.play()
if viewing_messages:
show_messages()
else:
elif not impacted:
show_notification(entry, second)
if notification_card.visible and second >= toast_until:
notification_card.visible = false
@@ -251,7 +256,7 @@ func show_notification(entry: Dictionary, second: float) -> void:
for state in ["normal","hover","pressed"]: dismiss.add_theme_stylebox_override(state,empty)
heading.add_child(dismiss)
var message := button(entry.text,"open_push",show_messages)
var message_size := ThemeDB.fallback_font.get_multiline_string_size(entry.text,HORIZONTAL_ALIGNMENT_LEFT,210,15)
var message_size := UI_FONT.get_multiline_string_size(entry.text,HORIZONTAL_ALIGNMENT_LEFT,210,15)
message.custom_minimum_size = Vector2(210,maxf(44,message_size.y))
message.alignment = HORIZONTAL_ALIGNMENT_LEFT
message.add_theme_font_size_override("font_size",15)
@@ -281,7 +286,7 @@ func modal() -> VBoxContainer:
var region := MarginContainer.new()
region.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
region.offset_left = 348
region.offset_right = -300
region.offset_right = -348
region.offset_top = 80
region.offset_bottom = -24
region.mouse_filter = Control.MOUSE_FILTER_IGNORE
@@ -356,7 +361,10 @@ func show_menu() -> void:
space.custom_minimum_size.y = 12
box.add_child(space)
if running or impacted:
menu_action(box,"Вернуться к звонку" if running else "Итоги звонка","resume",return_to_call,true)
menu_action(box,"Вернуться к звонку" if running else "Вернуться","resume",return_to_call,true)
if impacted:
menu_action(box,"Итоги звонка","outcome",show_outcome)
menu_action(box,"Сообщения от подруги","ending_messages",show_messages)
else:
menu_action(box,"Позвонить маме" if completed == 0 else "Продолжить · звонок %d" % mini(completed + 1, 10),"start",func(): dial_call(mini(completed+1,10),false),true)
menu_action(box,"Проверка сцен","testing",show_test_menu)
@@ -425,6 +433,9 @@ func dial_call(number: int, testing: bool, knowledge: int = 1, animate_in_qa: bo
dialing = true
running = false
impacted = false
ending_ready = false
screen_fade.color.a = 0
screen_fade.mouse_filter = Control.MOUSE_FILTER_IGNORE
close_overlay()
voice.stop()
effect.stop()
@@ -451,6 +462,8 @@ func begin_call(number: int, testing: bool, knowledge: int = 1) -> void:
facts = {}
for key in story.facts: facts[key] = true
chapter = clampi(number, 1, 10)
impacted = false
ending_ready = false
close_overlay()
voice.stop()
effect.stop()
@@ -463,6 +476,7 @@ func begin_call(number: int, testing: bool, knowledge: int = 1) -> void:
siren.stop()
soundscape.begin_call()
screen_fade.color.a = 0
screen_fade.mouse_filter = Control.MOUSE_FILTER_IGNORE
elapsed = 0
speech_until = 0
place = "flat"
@@ -497,7 +511,6 @@ func _process(_delta: float) -> void:
elapsed = second
advance()
update_notifications(second)
if impacted: screen_fade.color.a = lerpf(0.9,0.10,clampf((second-90.0)/1.8,0.0,1.0))
func advance() -> void:
if not running: return
@@ -660,41 +673,77 @@ func strike() -> void:
if not test_mode:
completed = maxi(completed, chapter)
save_progress()
screen_fade.color = Color(0, 0, 0, 0.94)
screen_fade.color = Color.BLACK
screen_fade.mouse_filter = Control.MOUSE_FILTER_STOP
stage.call_layout.hide()
notification_card.hide()
status_label.text = "Соединение прервано"
refresh_commands()
refresh_live()
if menu_screen == "main": show_menu()
if viewing_messages: show_messages()
elif menu_screen.is_empty(): close_overlay()
if qa_mode: return
var epoch := start_tick
await get_tree().create_timer(2.0).timeout
if epoch != start_tick or not impacted: return
screen_fade.color.a = 0.15
if outcome == "connected":
say("after_alive")
await get_tree().create_timer(voice_length("after_alive") + 1.0).timeout
await ending_line("after_alive",epoch)
if epoch != start_tick or not impacted: return
await ending_line("here",epoch)
else:
say("after_call")
await get_tree().create_timer(voice_length("after_call") + 0.8).timeout
if epoch == start_tick and impacted and not viewing_messages and menu_screen.is_empty(): show_ending()
await ending_line("after_call",epoch)
if epoch != start_tick or not impacted: return
ending_ready = true
var retry := action_button("retry")
if retry != null: retry.disabled = false
if menu_screen.is_empty(): show_ending()
func ending_line(id: String, epoch: int) -> void:
say(id)
await get_tree().create_timer(voice_length(id) + 0.25).timeout
while epoch == start_tick and impacted and voice_enabled and voice.playing:
await get_tree().process_frame
func show_ending() -> void:
close_overlay()
if not impacted or not ending_ready: return
var holder := Control.new()
holder.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
holder.mouse_filter = Control.MOUSE_FILTER_IGNORE
ui.add_child(holder)
overlay = holder
var cloud := PhoneStage.AnswerCloud.new()
cloud.centered_single = true
holder.add_child(cloud)
cloud.set_anchors_and_offsets_preset(Control.PRESET_CENTER)
cloud.offset_left = -300
cloud.offset_right = 300
cloud.offset_top = -150
cloud.offset_bottom = 150
var redial: Button = stage.chip("Позвонить Маме","next",func(): continue_call())
redial.add_theme_font_size_override("font_size",34)
redial.custom_minimum_size = Vector2(460,80)
cloud.add_child(redial)
func show_outcome() -> void:
if not impacted: return
var entry: Dictionary = story.endings[outcome]
var box := modal()
var box := menu_page("outcome")
box.add_child(label("ЗВОНОК ОБОРВАН · 01:30", 17, RED))
box.add_child(label(entry.title, 42))
box.add_child(label(entry.text, 23))
box.add_child(label("Знаний: %d / %d · Звонок: %d / 10" % [facts.size(), story.facts.size(), chapter], 18, MUTED))
if chapter == 10:
box.add_child(label("Ты могла выбирать слова и действия.\nТы не могла остановить то, что происходило с домом.", 22, ACCENT))
box.add_child(button("Перезвонить · следующая итерация" if chapter < 10 else "Ещё один звонок", "next", func(): continue_call()))
box.add_child(button("Повторить этот звонок", "retry", func(): continue_call(true)))
var retry := button("Повторить этот звонок", "retry", func(): continue_call(true))
retry.disabled = not ending_ready
box.add_child(retry)
box.add_child(button("Прочитать разговор", "transcript", show_transcript))
box.add_child(button("Сообщения от подруги", "ending_messages", show_messages))
box.add_child(button("В меню", "end_menu", show_menu))
func continue_call(retry: bool = false) -> void:
if not impacted or not ending_ready or dialing: return
# Test discoveries persist across test redials but never reach the disk save.
var remembered := facts.duplicate()
var number := chapter if retry else mini(chapter + 1, 10)
@@ -705,7 +754,7 @@ func continue_call(retry: bool = false) -> void:
refresh()
func show_transcript() -> void:
var box := modal()
var box := menu_page("transcript")
box.add_child(label("Последний разговор", 32))
var text := RichTextLabel.new()
text.custom_minimum_size = Vector2(640, 430)
@@ -713,7 +762,7 @@ func show_transcript() -> void:
for entry in archive:
text.append_text("%02d:%02d %s\n%s\n\n" % [int(entry.at) / 60, int(entry.at) % 60, entry.speaker, entry.text])
box.add_child(text)
box.add_child(button("Назад", "back_ending", show_ending))
box.add_child(button("Назад", "back_ending", show_outcome))
func refresh() -> void:
if not is_instance_valid(journal): return
+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
+6 -6
View File
@@ -126,13 +126,13 @@ func build(target: Node) -> void:
game.command_list.size_flags_vertical = Control.SIZE_EXPAND_FILL
choice_scroll.add_child(game.command_list)
var right := Control.new()
right.custom_minimum_size = Vector2(240,636)
right.custom_minimum_size = Vector2(288,636)
right.size_flags_vertical = Control.SIZE_SHRINK_CENTER
body.add_child(right)
mother_phone = Device.new()
right.add_child(mother_phone)
mother_phone.build(false)
mother_phone.position = Vector2(4,63)
mother_phone.position = Vector2(28,63)
var lcd: Control = mother_phone.display
var lcd_ink := Color("354633")
screen_text(lcd,"▮▮▮ ▰",3,20,12,lcd_ink)
@@ -141,7 +141,7 @@ func build(target: Node) -> void:
mother_clock = screen_text(lcd,"",110,25,18,lcd_ink)
game.objects_label = centered("",13,Color("777080"))
game.objects_label.position = Vector2(0,612)
game.objects_label.size = Vector2(240,55)
game.objects_label.size = Vector2(288,55)
right.add_child(game.objects_label)
# The full notebook remains available without occupying the call screen.
game.journal = RichTextLabel.new()
@@ -167,8 +167,8 @@ func build(target: Node) -> void:
func chip(text: String, id: String, callback: Callable) -> Button:
var node: Button = game.button(text,id,callback)
var width := clampf(ThemeDB.fallback_font.get_string_size(text,HORIZONTAL_ALIGNMENT_LEFT,-1,20).x+36,120,330)
var text_size := ThemeDB.fallback_font.get_multiline_string_size(text,HORIZONTAL_ALIGNMENT_CENTER,width-34,20,-1,TextServer.BREAK_MANDATORY | TextServer.BREAK_WORD_BOUND | TextServer.BREAK_ADAPTIVE)
var width := clampf(game.UI_FONT.get_string_size(text,HORIZONTAL_ALIGNMENT_LEFT,-1,20).x+36,120,330)
var text_size: Vector2 = game.UI_FONT.get_multiline_string_size(text,HORIZONTAL_ALIGNMENT_CENTER,width-34,20,-1,TextServer.BREAK_MANDATORY | TextServer.BREAK_WORD_BOUND | TextServer.BREAK_ADAPTIVE)
node.custom_minimum_size = Vector2(width,maxf(44,text_size.y+20))
node.add_theme_font_size_override("font_size",20)
node.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
@@ -205,7 +205,7 @@ func inbox() -> VBoxContainer:
func set_menu_mode(enabled: bool) -> void:
menu_mode = enabled
call_layout.visible = not enabled
call_layout.visible = not enabled and not game.impacted
game.screen_fade.visible = not enabled
glow.set_shader_parameter("menu_bokeh",1.0 if enabled else 0.0)