This commit is contained in:
Maurane
2026-08-16 01:06:53 +02:00
parent d0cdec4a6a
commit 59e9cb30a5
362 changed files with 4139 additions and 4487 deletions
+20 -24
View File
@@ -1,13 +1,11 @@
extends Control
@onready var tab_patient_file = $Margin/ComputerScreen/Tabs/PatientFile
@onready var tab_rules = $Margin/ComputerScreen/Tabs/Rules
@onready var tab_statistics = $Margin/ComputerScreen/Tabs/Statistics
@onready var tab_recording = $Margin/ComputerScreen/Tabs/Recording
@onready var patient_file = $Margin/ComputerScreen/ComputerTabs/FileContainer/PatientFile
@onready var rules = $Margin/ComputerScreen/ComputerTabs/Rules
@onready var statistics = $Margin/ComputerScreen/ComputerTabs/Statistics
@onready var recording = $Margin/ComputerScreen/ComputerTabs/Recording
@onready var screen = $Margin/ComputerScreen2
@onready var next_patient_button = $Margin/NextPatient/CallNextPatient
var tab_list
var screen_list
@@ -15,34 +13,23 @@ var screen_list
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
tab_list = [tab_patient_file, tab_rules, tab_recording]
screen_list = [patient_file, rules, recording]
tab_list = [tab_patient_file, tab_statistics, tab_recording]
screen_list = [patient_file, statistics, recording]
#Connecting signals
tab_patient_file.pressed.connect(self._on_tab_patient_file_pressed)
tab_rules.pressed.connect(self._on_tab_rules_pressed)
tab_statistics.pressed.connect(self._on_tab_statistics_pressed)
tab_recording.pressed.connect(self._on_tab_recording_pressed)
Globals.response_chosen.connect(self._on_response_chosen)
#Hiding everything
for node in tab_list + screen_list + [screen, next_patient_button]:
node.hide()
#Displays a message on the computer screen
func display(message):
var text = message.replace("\\n", "\n") #Replaces litteral backslashes by actual newlines (necessary because of Dialogue Manager)
screen.text = text
screen.show()
#Shows the patient file tab
func _on_tab_patient_file_pressed():
tab_switch(tab_patient_file, patient_file)
#Shows the rules tab
func _on_tab_rules_pressed():
tab_switch(tab_rules, rules)
#Shows the statistics tab
func _on_tab_statistics_pressed():
tab_switch(tab_statistics, statistics)
#Shows the recording tab
func _on_tab_recording_pressed():
@@ -79,8 +66,17 @@ func _on_response_chosen(response): #Adds protagonist responses to the recording
recording.append_text(response.text)
#Updates the statistics tab
func update_statistics(accurate_diagnoses, misdiagnoses):
var accurate_diagnoses_line = "ACCURATE DIAGNOSES : " + Globals.colorize(str(accurate_diagnoses), "green")
var misdiagnoses_line = "MISDIAGNOSES : " + Globals.colorize(str(misdiagnoses), "red")
statistics.text = accurate_diagnoses_line + "\n\n" + misdiagnoses_line
#Resets to initial state
func reset():
for node in tab_list + screen_list + [screen, next_patient_button]:
node.hide()
update_statistics(Globals.accurate_diagnoses, Globals.misdiagnoses)
patient_file.text = Globals.default_patient_file
recording.text = ""