This commit is contained in:
Maurane
2025-02-26 19:48:30 +01:00
parent 76312b34d9
commit 6d5f785962
7 changed files with 173 additions and 153 deletions
+37 -49
View File
@@ -2,66 +2,54 @@ extends Node
var emotion: String
var dialog_flags : Dictionary = {
"psychiatric_history": "not_asked",
"substance_use_history": "not_asked",
"lifestyle" : "not_asked",
"history_of_present_illness": "not_asked",
"appearance": "not_asked",
"behaviour": "not_asked",
"speech": "not_asked",
"thought_process": "not_asked",
"delusions": "not_asked",
"hallucinations": "not_asked",
"insight": "not_asked",
"sleep": "not_asked",
"mood": "not_asked",
"suicidal_ideation": "not_asked",
"history_of_present_illness": [],
"appearance": [],
"behaviour": [],
"speech": [],
"thought_process": [],
"thought_content": [],
"perceptions": [],
"insight": [],
"sleep": [],
"mood": [],
"suicidal_ideation": [],
}
var dialog_branch: Array = []
var dialog_tree: Dictionary = {"completed":false}
var dialog_tree: Dictionary
var marker: Array[int]
var marker: int = 0
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
dialog_branch.resize(100000)
#dialog_tree.merge({1:{"completed":false}})
#var tree = [110,120,121,122,130,210,220,230,310,320,330]
#build_dialog_tree(tree)
marker.resize(10)
marker.fill(0)
pass
func build_dialog_tree(tree) -> void:
var dialog_model = tree
var choices_max = []
var string_var = []
choices_max.resize(20)
print(tree.max())
choices_max[1] = str(tree.max()).split()[0]
for i in range(tree.size()):
if str(tree[i]).split()[0] == "1":
string_var.append(int(tree[i]))
choices_max[11] = str(string_var.max()).split()[1]
print(string_var.max())
print(choices_max[11])
print(choices_max[1])
for i in range(1,10):
add_branch(dialog_tree, i)
for i in range(1,10):
add_branch(dialog_tree[1], i)
for i in range (1,3):
add_branch(dialog_tree[1][2], i)
func add_branch(parent_branch: Dictionary, child_branch: int) -> void:
var new_branch = {child_branch: {"completed": false}}
parent_branch.merge(new_branch)
func build_dialog_tree(tree_model: Array[int]) -> Dictionary:
var branch : Dictionary
var tree : Dictionary
for branch_id in tree_model:
branch = {branch_id: "not_asked"}
tree.merge(branch)
return tree
func change_emotion(emotion) -> void:
func change_emotion(new_emotion: String) -> void:
emotion = new_emotion
pass
func send_to_reset() -> void:
pass
func send_to_isolation() -> void:
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass