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
+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