Sync student_progression + various cleaning / debug

This commit is contained in:
Adrien Ufferte
2025-06-23 15:21:16 +02:00
parent d344acb22d
commit 3be3e5bc49
7 changed files with 81 additions and 19 deletions
+5 -5
View File
@@ -8,11 +8,11 @@ enum Level {
Adult
}
@export var code: int
@export var name: String
@export var level: Level
@export var age: int
@export var last_modified: String
@export var code: int = 0
@export var name: String = ""
@export var level: Level = Level.Beginner
@export var age: int = 0
@export var last_modified: String = ""
func to_dict() -> Dictionary:
return {
+7 -1
View File
@@ -9,8 +9,9 @@ enum Status{
Completed,
}
@export var version: float = 1.0
@export var version: String = ProjectSettings.get_setting("application/config/version")
@export var unlocks: Dictionary = {}
@export var last_modified: String = ""
func _init() -> void:
@@ -47,6 +48,9 @@ func init_unlocks() -> bool:
unlocks[1]["look_and_learn"] = Status.Unlocked
has_changes = true
if has_changes:
last_modified = Time.get_datetime_string_from_system(true)
return has_changes
@@ -75,6 +79,7 @@ func look_and_learn_completed(lesson_number: int) -> bool:
for index: int in range(3):
unlocks[lesson_number]["games"][index] = Status.Unlocked
last_modified = Time.get_datetime_string_from_system(true)
unlocks_changed.emit()
return true
@@ -94,5 +99,6 @@ func game_completed(lesson_number: int, game_number: int) -> bool:
if all_completed and unlocks.has(lesson_number + 1):
unlocks[lesson_number + 1]["look_and_learn"] = Status.Unlocked
last_modified = Time.get_datetime_string_from_system(true)
unlocks_changed.emit()
return true