Clean & debug

This commit is contained in:
Adrien Ufferte
2025-06-24 15:52:19 +02:00
parent c56fa06211
commit deda564993
26 changed files with 66 additions and 65 deletions
+2 -2
View File
@@ -64,7 +64,7 @@ func set_flowers(p_flowers: Array[GardenLayout.Flower], default_size: FlowerSize
func update_flowers() -> void:
for index: int in flowers.size():
for index: int in range(flowers.size()):
if index >= flower_controls.size():
break
var flower: GardenLayout.Flower = flowers[index]
@@ -81,7 +81,7 @@ func update_flowers() -> void:
func set_lesson_buttons(p_lesson_buttons: Array[GardenLayout.GardenLayoutLessonButton]) -> void:
for lesson_button_control: LessonButton in lesson_button_controls:
lesson_button_control.visible = false
for index: int in p_lesson_buttons.size():
for index: int in range(p_lesson_buttons.size()):
if index >= lesson_button_controls.size():
break
var lesson_button: GardenLayout.GardenLayoutLessonButton = p_lesson_buttons[index]
+1 -1
View File
@@ -27,7 +27,7 @@ func init_unlocks() -> bool:
# Verify the lessons
var number_of_lessons: int = Database.get_lessons_count()
if unlocks.size() != number_of_lessons:
for index: int in number_of_lessons:
for index: int in range(number_of_lessons):
if not unlocks.has(index+1):
unlocks[index + 1] = {
"look_and_learn": Status.Locked,
+2 -2
View File
@@ -138,7 +138,7 @@ func get_all_students_data() -> Array[StudentData]:
func delete_student(student_code: int) -> void:
for device: int in students.keys():
for index: int in students[device].size():
for index: int in range(students[device].size()):
if students[device][index].code == student_code:
students[device].remove_at(index)
if students[device].is_empty():
@@ -154,7 +154,7 @@ func get_student_with_code(student_code: int) -> StudentData:
func get_student_device(student_code: int) -> int:
for device: int in students.keys():
for index: int in students[device].size():
for index: int in range(students[device].size()):
if students[device][index].code == student_code:
return device
return -1