screening_desk buttons

This commit is contained in:
2025-06-10 22:39:24 +02:00
parent fd4392ac69
commit 9b35d6ed82
17 changed files with 572 additions and 121 deletions
+126 -1
View File
@@ -1,12 +1,137 @@
extends Control
@onready var panel_container = $Background/HBoxContainer/MarginContainer/VBoxContainer/FaceMarginContainer/PanelContainer
@onready var margin_container = $Background/HBoxContainer/MarginContainer/VBoxContainer/FaceMarginContainer/PanelContainer/MarginContainer
@onready var patient_file = $Background/HBoxContainer/MarginContainer/VBoxContainer/FaceMarginContainer/PanelContainer/MarginContainer/FileContainer/PatientFile
@onready var patient_file_title = $Background/HBoxContainer/MarginContainer/VBoxContainer/FaceMarginContainer/PanelContainer/MarginContainer/FileContainer/HBoxContainer/PatientFileTitle
@onready var face_zoom = $Background/HBoxContainer/MarginContainer/VBoxContainer/FaceMarginContainer/FaceZoom
@onready var alone_controls = $Background/HBoxContainer/MarginContainer/VBoxContainer/ControlsMarginContainer/Alone
@onready var patient_controls = $Background/HBoxContainer/MarginContainer/VBoxContainer/ControlsMarginContainer/Patient
@onready var dialogue_resource: Resource
@onready var balloon: Node
@onready var patient_emotions : Dictionary
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
#Connecting signals
alone_controls.get_node("PatientFile").pressed.connect(self._patient_file)
patient_controls.get_node("PatientFile").pressed.connect(self._patient_file)
alone_controls.get_node("Guidebook").pressed.connect(self._guidebook)
patient_controls.get_node("Guidebook").pressed.connect(self._guidebook)
alone_controls.get_node("CallNextPatient").pressed.connect(self._call_next_patient)
patient_controls.get_node("PatientRecording").pressed.connect(self._patient_recording)
patient_controls.get_node("Examine").pressed.connect(self._examine)
#Instantiating a custom balloon
var Balloon: Resource = load("res://Dialogues/balloon.tscn")
balloon = Balloon.instantiate()
var panel = balloon.get_node("Balloon/Panel")
get_tree().current_scene.add_child(balloon)
balloon.name = "Balloon"
panel.size = Vector2(1260, 250)
#Hiding everything
self.hide()
pass # Replace with function body.
for node in margin_container.get_children():
node.hide()
panel_container.hide()
face_zoom.hide()
patient_controls.hide()
func gameplay_loop(patient_id):
new_patient(patient_id)
func new_patient(patient_id):
#Loading Patient Files
var file_path: String = "res://Dialogues/Patients/patient_" + String(patient_id) + "_file.txt"
print(file_path)
var file = FileAccess.open(file_path, FileAccess.READ)
var file_content = file.get_as_text()
patient_file.text = file_content
patient_file_title.text = "
PATIENT FILE #" + String(patient_id)
file.close()
#Loading Face Emotions
#Neutral
file_path = "res://Art/Patients/patient_" + String(patient_id) + "/patient_" + String(patient_id) + "_neutral.png"
var face = load(file_path)
var emotion = {"neutral": face}
patient_emotions.merge(emotion)
#Loading Default Face
face = patient_emotions["neutral"]
face_zoom.texture = face
#Loading Dialogue Resource
var dialogue_resource_path = "res://Dialogues/Patients/patient_" + String(patient_id) + ".dialogue"
dialogue_resource = load(dialogue_resource_path)
func _patient_file():
for node in margin_container.get_children():
node.hide()
panel_container.show()
face_zoom.hide()
margin_container.get_node("FileContainer").show()
func _guidebook():
for node in margin_container.get_children():
node.hide()
panel_container.show()
face_zoom.hide()
margin_container.get_node("Rules").show()
func _call_next_patient():
balloon.start(dialogue_resource, "start")
alone_controls.hide()
patient_controls.show()
func _patient_recording():
for node in margin_container.get_children():
node.hide()
panel_container.show()
face_zoom.hide()
margin_container.get_node("RecordingContainer").show()
func _examine():
for node in margin_container.get_children():
node.hide()
panel_container.hide()
face_zoom.show()
# Called every frame. 'delta' is the elapsed time since the previous frame.