Make graphical CCS dialogue choice first

This commit is contained in:
hz
2026-08-06 02:48:44 -05:00
parent 58dd370149
commit a0dae8e478
6 changed files with 66 additions and 16 deletions
+29 -5
View File
@@ -23,12 +23,13 @@ var dialogue_tween: Tween
var clock_seconds := 9.0 * 60.0 * 60.0
var debrief_panel: PanelContainer
var experience_mode := "management"
var pending_choices: Array = []
func _ready() -> void:
_update_clock()
_schedule_patient_blink()
show_patient_dialogue("Loading patient interview...")
hide_patient_dialogue()
hide_dialogue_choices()
@@ -89,12 +90,14 @@ func show_patient_dialogue(text: String, characters_per_second: float = 35.0) ->
var reveal_duration := float(text.length()) / maxf(characters_per_second, 1.0)
dialogue_tween = create_tween()
dialogue_tween.tween_property(dialogue_text, "visible_ratio", 1.0, reveal_duration)
dialogue_tween.finished.connect(_on_dialogue_reveal_finished)
func hide_patient_dialogue() -> void:
if dialogue_tween and dialogue_tween.is_valid():
dialogue_tween.kill()
dialogue_bubble.visible = false
pending_choices = []
func is_patient_dialogue_visible() -> bool:
@@ -113,14 +116,35 @@ func configure_interview(node: Dictionary) -> void:
if debrief_panel != null and is_instance_valid(debrief_panel):
debrief_panel.queue_free()
debrief_panel = null
show_patient_dialogue(str(node.get("patientText", "")))
var next_choices: Array
if bool(node.get("isTerminal", false)):
show_dialogue_choices([{
next_choices = [{
"id": "__continue",
"text": "Finish Interview" if experience_mode == "graphical_interview" else "Continue to Patient Management"
}])
}]
else:
show_dialogue_choices(node.get("choices", []))
next_choices = node.get("choices", [])
hide_dialogue_choices()
if bool(node.get("suppressPatientText", false)):
hide_patient_dialogue()
show_dialogue_choices(next_choices)
return
pending_choices = next_choices
show_patient_dialogue(str(node.get("patientText", "")))
func complete_dialogue_reveal() -> void:
if dialogue_tween and dialogue_tween.is_valid():
dialogue_tween.kill()
dialogue_text.visible_ratio = 1.0
_on_dialogue_reveal_finished()
func _on_dialogue_reveal_finished() -> void:
dialogue_tween = null
var choices := pending_choices
pending_choices = []
show_dialogue_choices(choices)
func set_choices_pending(pending: bool) -> void:
+11 -5
View File
@@ -92,18 +92,18 @@ func _render_state() -> void:
func _render_attempt(attempt: Dictionary) -> void:
if str(attempt.get("state", "")) != "active":
_handoff_to_classic_player()
_show_unsupported_attempt("This active case is not available in the graphical interview yet.")
return
var interview: Dictionary = attempt.get("interview", {})
if interview.is_empty():
_handoff_to_classic_player()
_show_unsupported_attempt("This active case does not include a graphical dialogue interview.")
return
var node: Dictionary = interview.get("currentNode", {})
if node.is_empty():
_handoff_to_classic_player()
_show_unsupported_attempt("The graphical interview could not load its current dialogue.")
return
if bool(attempt.get("openingCompleted", false)) and not bool(node.get("isTerminal", false)):
_handoff_to_classic_player()
_show_unsupported_attempt("This case has progressed beyond the graphical interview.")
return
_show_doctor_office(node, attempt)
@@ -120,7 +120,7 @@ func _build_selection_view() -> void:
heading.add_theme_font_size_override("font_size", 28)
selection_view.add_child(heading)
var description := Label.new()
description.text = "Begin a timed patient interview, then continue into clinical management."
description.text = "Interview the patient by selecting the questions you want to ask."
description.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
Brand.apply_font(description)
description.add_theme_font_size_override("font_size", 16)
@@ -158,6 +158,12 @@ func _show_selection(message: String = "") -> void:
retry_button.visible = false
func _show_unsupported_attempt(message: String) -> void:
_show_selection(message)
_clear_children(case_list)
status_label.text += " Finish or abandon it from CCS Cases before starting another graphical interview."
func _render_case_selection() -> void:
_show_selection()
_clear_children(case_list)