Various cleaning

This commit is contained in:
Adrien Ufferte
2025-04-24 10:00:18 +02:00
parent d8635d4d78
commit a4e76bb9dd
6 changed files with 34 additions and 35 deletions
+5 -5
View File
@@ -38,12 +38,12 @@ func update_from_dict(dict: Dictionary) -> void:
var d_students: Dictionary = dict.students var d_students: Dictionary = dict.students
for device: String in d_students.keys(): for device: String in d_students.keys():
var device_students: Array[StudentData] = [] var device_students: Array[StudentData] = []
for s: Dictionary in dict.students[device]: for student_dico: Dictionary in dict.students[device]:
var student: = StudentData.new() var student: = StudentData.new()
student.code = str(s.code) student.code = student_dico.code
student.name = s.name student.name = student_dico.name
student.age = s.age student.age = student_dico.age
student.level = s.level student.level = student_dico.level
device_students.append(student) device_students.append(student)
students[int(device)] = device_students students[int(device)] = device_students
+21 -21
View File
@@ -123,13 +123,13 @@ color = Color(0.00392157, 0, 0.105882, 1)
material = SubResource("CanvasItemMaterial_iw28k") material = SubResource("CanvasItemMaterial_iw28k")
position = Vector2(1280, 900) position = Vector2(1280, 900)
amount = 64 amount = 64
process_material = SubResource("ParticleProcessMaterial_x00r2")
texture = ExtResource("1_poeho") texture = ExtResource("1_poeho")
lifetime = 5.0 lifetime = 5.0
preprocess = 5.0 preprocess = 5.0
randomness = 0.5 randomness = 0.5
visibility_rect = Rect2(-12800, -900, 25600, 1800) visibility_rect = Rect2(-12800, -900, 25600, 1800)
local_coords = true local_coords = true
process_material = SubResource("ParticleProcessMaterial_x00r2")
[node name="TextureRect" type="TextureRect" parent="ControlBackground"] [node name="TextureRect" type="TextureRect" parent="ControlBackground"]
layout_mode = 0 layout_mode = 0
@@ -258,8 +258,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(59, 56) position = Vector2(59, 56)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton2" type="TextureButton" parent="GardenButtons"] [node name="GardenButton2" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -281,8 +281,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(50, 51.5) position = Vector2(50, 51.5)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton3" type="TextureButton" parent="GardenButtons"] [node name="GardenButton3" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -304,8 +304,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(59.5, 51) position = Vector2(59.5, 51)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton4" type="TextureButton" parent="GardenButtons"] [node name="GardenButton4" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -327,8 +327,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(56.5, 59.5) position = Vector2(56.5, 59.5)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton5" type="TextureButton" parent="GardenButtons"] [node name="GardenButton5" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -350,8 +350,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(56, 58) position = Vector2(56, 58)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton6" type="TextureButton" parent="GardenButtons"] [node name="GardenButton6" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -373,8 +373,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(59.5, 55.5) position = Vector2(59.5, 55.5)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton7" type="TextureButton" parent="GardenButtons"] [node name="GardenButton7" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -396,8 +396,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(56, 49) position = Vector2(56, 49)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton8" type="TextureButton" parent="GardenButtons"] [node name="GardenButton8" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -419,8 +419,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(54.5, 48.5) position = Vector2(54.5, 48.5)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton9" type="TextureButton" parent="GardenButtons"] [node name="GardenButton9" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -442,8 +442,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(71, 66) position = Vector2(71, 66)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton10" type="TextureButton" parent="GardenButtons"] [node name="GardenButton10" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -465,8 +465,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(54, 64.5) position = Vector2(54, 64.5)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton11" type="TextureButton" parent="GardenButtons"] [node name="GardenButton11" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -488,8 +488,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(68, 45.5) position = Vector2(68, 45.5)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton12" type="TextureButton" parent="GardenButtons"] [node name="GardenButton12" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -511,8 +511,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(57.5, 47.5) position = Vector2(57.5, 47.5)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton13" type="TextureButton" parent="GardenButtons"] [node name="GardenButton13" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -534,8 +534,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(51, 64.5) position = Vector2(51, 64.5)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton14" type="TextureButton" parent="GardenButtons"] [node name="GardenButton14" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -557,8 +557,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(47, 49) position = Vector2(47, 49)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton15" type="TextureButton" parent="GardenButtons"] [node name="GardenButton15" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -580,8 +580,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(53.5, 52.5) position = Vector2(53.5, 52.5)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton16" type="TextureButton" parent="GardenButtons"] [node name="GardenButton16" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -603,8 +603,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(82.5, 50) position = Vector2(82.5, 50)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton17" type="TextureButton" parent="GardenButtons"] [node name="GardenButton17" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -626,8 +626,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(52, 54) position = Vector2(52, 54)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton18" type="TextureButton" parent="GardenButtons"] [node name="GardenButton18" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -649,8 +649,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(60.5, 47.5) position = Vector2(60.5, 47.5)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton19" type="TextureButton" parent="GardenButtons"] [node name="GardenButton19" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -672,8 +672,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(46.5, 53) position = Vector2(46.5, 53)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="GardenButton20" type="TextureButton" parent="GardenButtons"] [node name="GardenButton20" type="TextureButton" parent="GardenButtons"]
unique_name_in_owner = true unique_name_in_owner = true
@@ -695,8 +695,8 @@ material = SubResource("CanvasItemMaterial_4xkmy")
position = Vector2(59.5, 47) position = Vector2(59.5, 47)
scale = Vector2(0.4, 0.4) scale = Vector2(0.4, 0.4)
emitting = false emitting = false
process_material = SubResource("ParticleProcessMaterial_4003t")
texture = ExtResource("33_bjun2") texture = ExtResource("33_bjun2")
process_material = SubResource("ParticleProcessMaterial_4003t")
[node name="Kalulu" parent="." instance=ExtResource("35_t3kvk")] [node name="Kalulu" parent="." instance=ExtResource("35_t3kvk")]
visible = false visible = false
@@ -44,6 +44,7 @@ func _draw_password() -> void:
var i: = 0 var i: = 0
for value in password.split(""): for value in password.split(""):
if i >= 3: if i >= 3:
push_error("A password cannot be more than 3 characters long")
return return
if value in icons_textures: if value in icons_textures:
-2
View File
@@ -188,7 +188,6 @@ func _notification(what):
if not _is_paused: if not _is_paused:
_pause_start = Time.get_ticks_msec() / 1000.0 _pause_start = Time.get_ticks_msec() / 1000.0
_is_paused = true _is_paused = true
print("⏸️ Pause detected at %.2f" % _pause_start)
NOTIFICATION_APPLICATION_FOCUS_IN: NOTIFICATION_APPLICATION_FOCUS_IN:
if _is_paused: if _is_paused:
@@ -196,7 +195,6 @@ func _notification(what):
var pause_duration = resumed - _pause_start var pause_duration = resumed - _pause_start
_elapsed_paused += pause_duration _elapsed_paused += pause_duration
_is_paused = false _is_paused = false
print("▶️ Resume, pause duration %.2f sec, total pause : %.2f sec" % [pause_duration, _elapsed_paused])
#endregion #endregion
#region Ending #region Ending
@@ -66,7 +66,7 @@ func _find_stimuli_and_distractions() -> void:
else: else:
stimuli.append_array(current_lesson_stimuli) stimuli.append_array(current_lesson_stimuli)
# We if there are not enough stimuli from current lesson, we want at least half the target number of stimuli # If there are not enough stimuli from current lesson, we want at least half the target number of stimuli
@warning_ignore("integer_division") @warning_ignore("integer_division")
var minimal_stimuli : int = current_lesson_stimuli_number/2 var minimal_stimuli : int = current_lesson_stimuli_number/2
if stimuli.size() < minimal_stimuli: if stimuli.size() < minimal_stimuli:
@@ -95,7 +95,7 @@ func _find_stimuli_and_distractions() -> void:
for stimulus: Dictionary in stimuli: for stimulus: Dictionary in stimuli:
var stimulus_distractors: Array[Dictionary] = [] var stimulus_distractors: Array[Dictionary] = []
# Difficulty 1 # Difficulty 1
# Any previously learned item w/ all letters different # Any previously learned item w/ all letters different
for syllable: Dictionary in all_syllables: for syllable: Dictionary in all_syllables:
if syllable.Phoneme != stimulus.Phoneme: if syllable.Phoneme != stimulus.Phoneme:
+5 -5
View File
@@ -284,7 +284,7 @@ func _delete_inexistants_students_saves() -> void:
# Check if the folder is associated with an existing student # Check if the folder is associated with an existing student
var exists: = false var exists: = false
for s: StudentData in teacher_settings.students[int(device)]: for s: StudentData in teacher_settings.students[int(device)]:
if s.code == p_student: if str(s.code) == p_student:
exists = true exists = true
break break
# If the code doesn't exists in the configuration, delete the folder # If the code doesn't exists in the configuration, delete the folder
@@ -349,11 +349,11 @@ func _on_user_progression_unlocks_changed() -> void:
_save_student_progression() _save_student_progression()
func get_student_progression_for_code(device: int, code: String) -> UserProgression: func get_student_progression_for_code(device: int, code: int) -> UserProgression:
if not teacher_settings or not teacher_settings.students.has(device): if not teacher_settings or not teacher_settings.students.has(device):
return return
var student_path: String ="user://".path_join(_device_settings.teacher).path_join(str(device)).path_join(_device_settings.language).path_join(code) var student_path: String ="user://".path_join(_device_settings.teacher).path_join(str(device)).path_join(_device_settings.language).path_join(str(code))
var progression_path: String = student_path.path_join("progression.tres") var progression_path: String = student_path.path_join("progression.tres")
var progression: UserProgression var progression: UserProgression
@@ -367,8 +367,8 @@ func get_student_progression_for_code(device: int, code: String) -> UserProgress
return progression return progression
func save_student_progression_for_code(device: int, code: String, progression: UserProgression) -> void: func save_student_progression_for_code(device: int, code: int, progression: UserProgression) -> void:
var progression_path: String = "user://".path_join(_device_settings.teacher).path_join(str(device)).path_join(_device_settings.language).path_join(code).path_join("progression.tres") var progression_path: String = "user://".path_join(_device_settings.teacher).path_join(str(device)).path_join(_device_settings.language).path_join(str(code)).path_join("progression.tres")
ResourceSaver.save(progression, progression_path) ResourceSaver.save(progression, progression_path)
#endregion #endregion