Make graphical CCS dialogue choice first
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user