Add simulated CCS computer

This commit is contained in:
hz
2026-08-07 18:31:00 -05:00
parent 41b3092552
commit e50a97ba91
9 changed files with 235 additions and 1 deletions
+18
View File
@@ -85,6 +85,16 @@ func _run() -> void:
_assert(screen.current_view == "doctor_office", "an active interactive attempt should open the doctor office")
_assert(not screen.active_scene.is_patient_dialogue_visible(), "the opening should wait for a clinician dialogue selection")
_assert(screen.active_scene.choice_container.get_child_count() == 1, "the scene should render server-provided dialogue choices")
_assert(screen.active_scene.computer_launcher.visible, "the doctor office should expose the simulated computer launcher")
_assert(screen.active_scene.computer_launcher.icon.resource_path.ends_with("monitor.svg"), "the computer launcher should use the monitor icon")
screen.active_scene.computer_launcher.pressed.emit()
_assert(screen.active_scene.is_computer_open(), "the computer launcher should open the simulated desktop")
_assert(not screen.active_scene.computer_launcher.visible, "the launcher should hide while the computer is open")
_assert(screen.active_scene.computer_overlay.get_node("Screen").texture.resource_path.ends_with("computer-base.png"), "the overlay should render the supplied computer base")
_assert(screen.active_scene.computer_overlay.get_node("Screen").stretch_mode == TextureRect.STRETCH_KEEP_ASPECT_CENTERED, "the computer should be fully contained without cropping")
_assert(screen.close_transient_overlay(), "Escape routing should close the computer before the pause menu")
_assert(not screen.active_scene.is_computer_open(), "closing the transient overlay should restore the doctor office")
_assert(not screen.close_transient_overlay(), "a second Escape should be available to open the pause menu")
_assert(is_equal_approx(screen.stage_root.scale.x, screen.stage_root.scale.y), "the graphical stage should preserve its aspect ratio")
var stale_graphical_attempt := _sample_attempt(false)
stale_graphical_attempt.experienceMode = "graphical_interview"
@@ -106,6 +116,13 @@ func _run() -> void:
_assert(screen.active_scene.dialogue_continue_hint.text == "Click to continue", "every dialogue page should use supported continuation wording")
_assert(screen.active_scene.dialogue_text.visible_characters_behavior == TextServer.VC_CHARS_AFTER_SHAPING, "typewriter text should wrap before glyphs are revealed")
var wrapped_line_count: int = screen.active_scene.dialogue_text.get_line_count()
screen.active_scene.open_computer()
var computer_blocked_page: int = screen.active_scene.dialogue_page_index
var computer_click := _left_click(screen.active_scene.get_global_rect().get_center())
screen.active_scene._input(computer_click)
_assert(screen.active_scene.dialogue_page_index == computer_blocked_page and not screen.active_scene.dialogue_reveal_complete, "the open computer should block scene-wide dialogue clicks")
screen.active_scene.computer_close_button.pressed.emit()
_assert(not screen.active_scene.is_computer_open(), "the computer close button should return to the interview")
var outside_click := _left_click(screen.active_scene.get_global_rect().end + Vector2(50.0, 50.0))
screen.active_scene._input(outside_click)
_assert(not screen.active_scene.dialogue_reveal_complete, "clicks outside the doctor scene should not affect dialogue")
@@ -169,6 +186,7 @@ func _run() -> void:
await process_frame
_assert(screen.current_view == "interview_debrief", "a completed graphical interview should remain in CCS Cases 2")
_assert(screen.active_scene.find_child("InterviewDebrief", true, false) != null, "the graphical case should render its debrief")
_assert(not screen.active_scene.computer_launcher.visible, "the computer launcher should stay hidden during the interview debrief")
var sizing_scene = load("res://scenes/ccs_cases_2/doctor_office.tscn").instantiate()
host.add_child(sizing_scene)