diff --git a/addons/godot-form-validator/example/example.tscn b/addons/godot-form-validator/example/example.tscn index e9f6da80..c0a6e760 100644 --- a/addons/godot-form-validator/example/example.tscn +++ b/addons/godot-form-validator/example/example.tscn @@ -58,7 +58,7 @@ rules = Array[ExtResource("4_d7ctn")]([SubResource("Resource_j4pud"), SubResourc [sub_resource type="Resource" id="Resource_ftvbf"] script = ExtResource("8_mu0ia") -fail_message = "Value must contain only alphanumeric cahracters." +fail_message = "Value must contain only alphanumeric characters." [sub_resource type="Resource" id="Resource_my5ss"] script = ExtResource("5_cu56g") diff --git a/addons/godot-form-validator/rules/alphanumeric_rule.gd b/addons/godot-form-validator/rules/alphanumeric_rule.gd index 6da36301..50a5a482 100644 --- a/addons/godot-form-validator/rules/alphanumeric_rule.gd +++ b/addons/godot-form-validator/rules/alphanumeric_rule.gd @@ -4,7 +4,7 @@ class_name AlphanumericRule func _init() -> void: - fail_message = "Value must contain only alphanumeric cahracters." + fail_message = "Value must contain only alphanumeric characters." func apply(control: Control, value) -> RuleResult: diff --git a/assets/minigames/jellyfish/graphic/backgroung.png b/assets/minigames/jellyfish/graphic/background.png similarity index 100% rename from assets/minigames/jellyfish/graphic/backgroung.png rename to assets/minigames/jellyfish/graphic/background.png diff --git a/assets/minigames/jellyfish/graphic/backgroung.png.import b/assets/minigames/jellyfish/graphic/background.png.import similarity index 70% rename from assets/minigames/jellyfish/graphic/backgroung.png.import rename to assets/minigames/jellyfish/graphic/background.png.import index 59dd6a6c..d815fb00 100644 --- a/assets/minigames/jellyfish/graphic/backgroung.png.import +++ b/assets/minigames/jellyfish/graphic/background.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://c7oq86cgq7okn" -path="res://.godot/imported/backgroung.png-b9425654c65da19cbab4cf27155ecc60.ctex" +path="res://.godot/imported/background.png-efb3c9298c89dad479689fd212c0f1b2.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/minigames/jellyfish/graphic/backgroung.png" -dest_files=["res://.godot/imported/backgroung.png-b9425654c65da19cbab4cf27155ecc60.ctex"] +source_file="res://assets/minigames/jellyfish/graphic/background.png" +dest_files=["res://.godot/imported/background.png-efb3c9298c89dad479689fd212c0f1b2.ctex"] [params] diff --git a/resources/device_settings.gd b/resources/device_settings.gd index 4ea93462..a44e85a6 100644 --- a/resources/device_settings.gd +++ b/resources/device_settings.gd @@ -24,7 +24,7 @@ const SUPPORTED_LOCALES: Array[String] = [ print("DeviceSettings: language SET: " + TranslationServer.get_locale()) @export var teacher: String @export var device_id: int -@export var language_versions: Dictionary = {} # locale : datetime +@export var language_versions: Dictionary = {} # locale: datetime @export var master_volume: float = 0.0: set(volume): diff --git a/resources/user/student_progression.gd b/resources/user/student_progression.gd index 9b31c4b3..58528953 100644 --- a/resources/user/student_progression.gd +++ b/resources/user/student_progression.gd @@ -23,7 +23,7 @@ func init_unlocks() -> bool: if not unlocks: unlocks = {} - # Verifiy the lessons + # 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: diff --git a/resources/user/teacher_settings.gd b/resources/user/teacher_settings.gd index 29f8926e..9f846b50 100644 --- a/resources/user/teacher_settings.gd +++ b/resources/user/teacher_settings.gd @@ -17,7 +17,7 @@ enum EducationMethod { @export var account_type: AccountType @export var education_method: EducationMethod var devices_count: int -@export var students: Dictionary[int, Array] = {} # int (device) : Array[StudentData] +@export var students: Dictionary[int, Array] = {} # int (device): Array[StudentData] @export var email: String var password: String @export var token: String @@ -126,14 +126,14 @@ func get_number_of_students() -> int: if not students: return 0 var result: int = 0 - for datas: Array[StudentData] in students.values(): - result += datas.size() + for data: Array[StudentData] in students.values(): + result += data.size() return result func get_all_students_data() -> Array[StudentData]: var result: Array[StudentData] - for datas: Array[StudentData] in students.values(): - result.append_array(datas) + for data: Array[StudentData] in students.values(): + result.append_array(data) return result func delete_student(student_code: int) -> void: diff --git a/resources/user/user_difficulty.gd b/resources/user/user_difficulty.gd index 9ed27574..b8dec247 100644 --- a/resources/user/user_difficulty.gd +++ b/resources/user/user_difficulty.gd @@ -4,7 +4,7 @@ class_name UserDifficulty signal difficulty_changed() # Stores the user history for all the minigames -# Key -> minigame_name : String +# Key -> minigame_name: String # Value -> UserMinigameHistory @export var minigames_histories: Dictionary = {} diff --git a/sources/gardens/gardens.gd b/sources/gardens/gardens.gd index 02f8c222..bc71cb2f 100644 --- a/sources/gardens/gardens.gd +++ b/sources/gardens/gardens.gd @@ -225,10 +225,10 @@ func _ready() -> void: var unlock: Dictionary = UserDataManager.student_progression.unlocks[lesson_ind] var look_and_learn_unlocked: bool = unlock["look_and_learn"] == StudentProgression.Status.Unlocked - var exercice_unlock_1: bool = unlock["games"][0] == StudentProgression.Status.Unlocked - var exercice_unlock_2: bool = unlock["games"][1] == StudentProgression.Status.Unlocked - var exercice_unlock_3: bool = unlock["games"][2] == StudentProgression.Status.Unlocked - if look_and_learn_unlocked or exercice_unlock_1 or exercice_unlock_2 or exercice_unlock_3: + var exercise_unlock_1: bool = unlock["games"][0] == StudentProgression.Status.Unlocked + var exercise_unlock_2: bool = unlock["games"][1] == StudentProgression.Status.Unlocked + var exercise_unlock_3: bool = unlock["games"][2] == StudentProgression.Status.Unlocked + if look_and_learn_unlocked or exercise_unlock_1 or exercise_unlock_2 or exercise_unlock_3: starting_garden = garden_ind break else: @@ -323,7 +323,7 @@ func _ready() -> void: for index: int in garden_control.lesson_button_controls.size(): if lesson_ind == max_lesson + 1: new_lesson_button = garden_control.lesson_button_controls[index] - if lesson_ind == max_lesson : + if lesson_ind == max_lesson: last_lesson_button = garden_control.lesson_button_controls[index] if index == garden_control.lesson_button_controls.size() -1: is_last_lesson_of_garden = true @@ -404,7 +404,7 @@ func _open_minigames_layout(button: LessonButton, lesson_ind: int) -> void: in_minigame_selection = true # Gets the correct exercises for the lesson - var exercises: Array[int] = Database.get_exercice_for_lesson(lesson_ind) + var exercises: Array[int] = Database.get_exercise_for_lesson(lesson_ind) if not exercises or exercises.size() < 3: return @@ -421,7 +421,7 @@ func _open_minigames_layout(button: LessonButton, lesson_ind: int) -> void: var are_minigames_locked: bool = lesson_unlocks["games"][0] == StudentProgression.Status.Locked and lesson_unlocks["games"][1] == StudentProgression.Status.Locked and lesson_unlocks["games"][2] == StudentProgression.Status.Locked - # Desactivate the mouse filters on the buttons behind the layout + # Deactivate the mouse filters on the buttons behind the layout for l_button: LessonButton in current_garden.lesson_button_controls: l_button.mouse_filter = Control.MOUSE_FILTER_IGNORE diff --git a/sources/kalulu.gd b/sources/kalulu.gd index e473f337..0410f493 100644 --- a/sources/kalulu.gd +++ b/sources/kalulu.gd @@ -9,9 +9,9 @@ func _on_animation_finished() -> void: match animation: "Idle1", "Idle2": - if rand < 0.5 : + if rand < 0.5: play("Idle1") - else : + else: play("Idle2") "Talk1", "Talk2", "Talk3": if rand < 1.0 / 3.0: @@ -21,9 +21,9 @@ func _on_animation_finished() -> void: else: play("Talk3") "Tc_Idle1", "Tc_Idle2": - if rand < 0.5 : + if rand < 0.5: play("Tc_Idle1") - else : + else: play("Tc_Idle2") "Tc_Talk1", "Tc_Talk2", "Tc_Talk3": if rand < 1.0 / 3.0: diff --git a/sources/language_tool/lesson_exercises.gd b/sources/language_tool/lesson_exercises.gd index 35c7c6c0..d452d0e2 100644 --- a/sources/language_tool/lesson_exercises.gd +++ b/sources/language_tool/lesson_exercises.gd @@ -1,6 +1,6 @@ extends Control -const LESSON_EXERCICE_CONTAINER_SCENE: PackedScene = preload("res://sources/language_tool/lesson_exercises_container.tscn") +const LESSON_EXERCISE_CONTAINER_SCENE: PackedScene = preload("res://sources/language_tool/lesson_exercises_container.tscn") @onready var lessons_container: VBoxContainer = %LessonsContainer @@ -42,7 +42,7 @@ func _ready() -> void: var sentences_by_lesson: Dictionary = Database.get_sentences_by_lessons() Database.db.query("Select * FROM Lessons") for result: Dictionary in Database.db.query_result: - var container: LessonExerciceContainer = LESSON_EXERCICE_CONTAINER_SCENE.instantiate() + var container: LessonExerciseContainer = LESSON_EXERCISE_CONTAINER_SCENE.instantiate() lessons_container.add_child(container) container.sentences_by_lesson = sentences_by_lesson container.lesson_number = result.LessonNb @@ -50,7 +50,7 @@ func _ready() -> void: func _on_save_button_pressed() -> void: - for container: LessonExerciceContainer in lessons_container.get_children(): + for container: LessonExerciseContainer in lessons_container.get_children(): container._on_save_button_pressed() diff --git a/sources/language_tool/lesson_exercises_container.gd b/sources/language_tool/lesson_exercises_container.gd index 0e7e7337..4313d32b 100644 --- a/sources/language_tool/lesson_exercises_container.gd +++ b/sources/language_tool/lesson_exercises_container.gd @@ -1,5 +1,5 @@ extends PanelContainer -class_name LessonExerciceContainer +class_name LessonExerciseContainer @export var lesson_number: = -1: set = _set_lesson_number diff --git a/sources/language_tool/prof_tool_menu.gd b/sources/language_tool/prof_tool_menu.gd index 36a673e9..9027a966 100644 --- a/sources/language_tool/prof_tool_menu.gd +++ b/sources/language_tool/prof_tool_menu.gd @@ -557,7 +557,7 @@ func create_book() -> void: var file_path: String = lang_path.path_join(file_names[category]) var file: FileAccess = FileAccess.open(file_path, FileAccess.READ) if file == null: - Logger.error("ProfToolMenu: Erreur d'ouverture : " + file_path) + Logger.error("ProfToolMenu: Error opening file: " + file_path) continue if file.eof_reached(): @@ -601,7 +601,7 @@ func create_book() -> void: var values: PackedStringArray = parse_csv_line(line) if values.size() != raw_headers.size(): - Logger.warn("ProfToolMenu: Ligne malformée ignorée : %s" % values) + Logger.warn("ProfToolMenu: Malformed line ignored: %s" % values) continue var row_dict: Dictionary[String, String] = {} @@ -634,7 +634,7 @@ func create_book() -> void: var output_path: String = lang_path.path_join("booklet.csv") var output_file: FileAccess = FileAccess.open(output_path, FileAccess.WRITE) if output_file == null: - Logger.error("ProfToolMenu: Impossible d'écrire : " + output_path) + Logger.error("ProfToolMenu: Impossible to write: " + output_path) return output_file.store_line(escape_csv_line(PackedStringArray(ordered_headers))) @@ -648,7 +648,7 @@ func create_book() -> void: output_file.close() - error_label.text = "📘 Export des données du livret terminé vers : " + output_path + error_label.text = "📘 Export data of the booklet finished to path: " + output_path Logger.trace("ProfToolMenu: " + error_label.text) # Fonction qui ajoute une ligne au dictionnaire @@ -668,7 +668,7 @@ func add_row(dict: Dictionary[String, PackedStringArray], row_data: Dictionary[S dict[header] = filler dict[header].append(row_data.get(header, "") as String) - # Colonne spéciale : Categorie + # Special column: "Categorie" if not dict.has("Categorie"): var filler: PackedStringArray filler.resize(current_size) @@ -732,8 +732,8 @@ func read_csv_record(file: FileAccess) -> String: record += line var quote_count: int = 0 - for char: String in line: - if char == "\"": + for chara: String in line: + if chara == "\"": quote_count += 1 open_quotes = (quote_count % 2 != 0) diff --git a/sources/menus/adult_check/adult_check.gd b/sources/menus/adult_check/adult_check.gd index d313a67f..e8879bee 100644 --- a/sources/menus/adult_check/adult_check.gd +++ b/sources/menus/adult_check/adult_check.gd @@ -3,16 +3,16 @@ extends Control const MAIN_MENU_SCENE_PATH: String = "res://sources/menus/main/main_menu.tscn" const REGISTER_SCENE_PATH: String = "res://sources/menus/register/register.tscn" const SYMBOLS_NAMES: Dictionary[String, String] = { - "1" : "STAR", - "2" : "BAR", - "3" : "CIRCLE", - "4" : "PLUS", - "5" : "SQUARE", - "6" : "TRIANGLE", + "1": "STAR", + "2": "BAR", + "3": "CIRCLE", + "4": "PLUS", + "5": "SQUARE", + "6": "TRIANGLE", } -@onready var code_keyboard : CodeKeyboard = %CodeKeyboard -@onready var password_label : Label = %PasswordLabel +@onready var code_keyboard: CodeKeyboard = %CodeKeyboard +@onready var password_label: Label = %PasswordLabel var password: String = "" @@ -27,9 +27,9 @@ func _reset_password() -> void: var password_array: PackedStringArray = password.split("") password_label.text = tr("ADULT_CHECK_PROMPT").format( { - "1" : tr(SYMBOLS_NAMES[password_array[0]]), - "2" : tr(SYMBOLS_NAMES[password_array[1]]), - "3" : tr(SYMBOLS_NAMES[password_array[2]]) + "1": tr(SYMBOLS_NAMES[password_array[0]]), + "2": tr(SYMBOLS_NAMES[password_array[1]]), + "3": tr(SYMBOLS_NAMES[password_array[2]]) } ) diff --git a/sources/menus/brain/brain.gd b/sources/menus/brain/brain.gd index e3a07790..fb98debf 100644 --- a/sources/menus/brain/brain.gd +++ b/sources/menus/brain/brain.gd @@ -107,11 +107,11 @@ func _play_tutorial() -> void: kalulu_button.hide() while tutorial_count < tutorial_speeches.size(): - if tutorial_count == 0: # first speech : play "show" + if tutorial_count == 0: # first speech: play "show" await kalulu.play_kalulu_speech(tutorial_speeches[tutorial_count], true, false) elif tutorial_count + 1 < tutorial_speeches.size(): await kalulu.play_kalulu_speech(tutorial_speeches[tutorial_count], false, false) - else: # last speech : play "hide" + else: # last speech: play "hide" await kalulu.play_kalulu_speech(tutorial_speeches[tutorial_count], false, true) tutorial_count += 1 await get_tree().create_timer(0.5).timeout diff --git a/sources/menus/components/code_keyboard.gd b/sources/menus/components/code_keyboard.gd index ca7062a9..ad79b7e2 100644 --- a/sources/menus/components/code_keyboard.gd +++ b/sources/menus/components/code_keyboard.gd @@ -1,26 +1,26 @@ extends Control class_name CodeKeyboard -signal button_pressed(key : String, password : Array[String]) -signal password_entered(password : String) +signal button_pressed(key: String, password: Array[String]) +signal password_entered(password: String) -@onready var password_visualizer : PasswordVisualizer = %PasswordVisualizer +@onready var password_visualizer: PasswordVisualizer = %PasswordVisualizer @onready var buttons: GridContainer = %Buttons @onready var sound_player: AudioStreamPlayer = $ButtonSoundPlayer -var password : Array[String] = [] +var password: Array[String] = [] func _ready() -> void: for button: TextureButton in buttons.get_children(false): button.pressed.connect(_on_button_pressed.bind(button)) -func _on_button_pressed(button : TextureButton) -> void: +func _on_button_pressed(button: TextureButton) -> void: if password.size() == 3: return # Gets the pressed key - var key : String = button.name + var key: String = button.name password.append(key) # Sound effect diff --git a/sources/menus/components/password_visualizer.gd b/sources/menus/components/password_visualizer.gd index 8ba860fd..620ab0b4 100644 --- a/sources/menus/components/password_visualizer.gd +++ b/sources/menus/components/password_visualizer.gd @@ -3,12 +3,12 @@ extends HBoxContainer class_name PasswordVisualizer const ICONS_TEXTURES: Dictionary[String, CompressedTexture2D] = { - "1" : preload("res://assets/menus/login/symbol_01.png"), - "2" : preload("res://assets/menus/login/symbol_02.png"), - "3" : preload("res://assets/menus/login/symbol_03.png"), - "4" : preload("res://assets/menus/login/symbol_04.png"), - "5" : preload("res://assets/menus/login/symbol_05.png"), - "6" : preload("res://assets/menus/login/symbol_06.png") + "1": preload("res://assets/menus/login/symbol_01.png"), + "2": preload("res://assets/menus/login/symbol_02.png"), + "3": preload("res://assets/menus/login/symbol_03.png"), + "4": preload("res://assets/menus/login/symbol_04.png"), + "5": preload("res://assets/menus/login/symbol_05.png"), + "6": preload("res://assets/menus/login/symbol_06.png") } @export var key_size: int = 200: diff --git a/sources/menus/language_selection/package_downloader.gd b/sources/menus/language_selection/package_downloader.gd index 240a740d..31fb349b 100644 --- a/sources/menus/language_selection/package_downloader.gd +++ b/sources/menus/language_selection/package_downloader.gd @@ -175,11 +175,11 @@ func _copy_data(this: PackageDownloader) -> void: func delete_directory_recursive(path: String) -> void: var dir: DirAccess = DirAccess.open(path) if dir == null: - Logger.error("PackageDownloader: Folder does not exists : %s" % path) + Logger.error("PackageDownloader: Folder does not exists: %s" % path) return if dir.list_dir_begin() != OK: - Logger.error("PackageDownloader: Error while reading folder : %s" % path) + Logger.error("PackageDownloader: Error while reading folder: %s" % path) return var err: Error @@ -191,7 +191,7 @@ func delete_directory_recursive(path: String) -> void: else: err = dir.remove(full_path) if err != OK: - Logger.error("PackageDownloader: Error " + error_string(err) + " while deleting file : %s" % full_path) + Logger.error("PackageDownloader: Error " + error_string(err) + " while deleting file: %s" % full_path) file_name = dir.get_next() dir.list_dir_end() @@ -199,9 +199,9 @@ func delete_directory_recursive(path: String) -> void: # Supprime le dossier lui-même err = DirAccess.remove_absolute(path) if err != OK: - Logger.error("PackageDownloader: Error " + error_string(err) + " while deleting folder : %s" % path) + Logger.error("PackageDownloader: Error " + error_string(err) + " while deleting folder: %s" % path) else: - Logger.info("PackageDownloader: ✅ Folder deleted : %s" % path) + Logger.info("PackageDownloader: ✅ Folder deleted: %s" % path) func _delete_dir(path: String) -> void: diff --git a/sources/menus/login/login.gd b/sources/menus/login/login.gd index b1dd5d28..056cd791 100644 --- a/sources/menus/login/login.gd +++ b/sources/menus/login/login.gd @@ -1,6 +1,6 @@ extends Control -const TEACHER_PASSWORD : String = "42" +const TEACHER_PASSWORD: String = "42" const BACK_SCENE_PATH: String = "res://sources/menus/main/main_menu.tscn" const NEXT_SCENE_PATH: String = "res://sources/menus/brain/brain.tscn" const TEACHER_SCENE_PATH: String = "res://sources/menus/settings/teacher_settings.tscn" @@ -9,10 +9,10 @@ const PACKAGE_LOADER_SCENE_PATH: String = "res://sources/menus/language_selectio const KALULU: = preload("res://sources/minigames/base/kalulu.gd") @onready var kalulu: KALULU = $Kalulu -@onready var music_player : AudioStreamPlayer = $MusicStreamPlayer +@onready var music_player: AudioStreamPlayer = $MusicStreamPlayer @onready var device_number_label: Label = $DeviceNumber -@onready var keyboard : CodeKeyboard = $CodeKeyboard -@onready var teacher_timer : Timer = %TeacherTimer +@onready var keyboard: CodeKeyboard = $CodeKeyboard +@onready var teacher_timer: Timer = %TeacherTimer @onready var teacher_help_label: Label = %TeacherHelpLabel @onready var kalulu_button: CanvasItem = %KaluluButton @@ -33,7 +33,7 @@ func _ready() -> void: right_password_speech = Database.load_external_sound(Database.get_kalulu_speech_path("login_screen", "feedback_right_password")) device_number_label.show() - device_number_label.text = tr("DEVICE_NUMBER").format({"number" : UserDataManager.get_device_settings().device_id}) + device_number_label.text = tr("DEVICE_NUMBER").format({"number": UserDataManager.get_device_settings().device_id}) await OpeningCurtain.open() diff --git a/sources/menus/main/kalulu.gd b/sources/menus/main/kalulu.gd index c09fedc6..4e018803 100644 --- a/sources/menus/main/kalulu.gd +++ b/sources/menus/main/kalulu.gd @@ -6,7 +6,7 @@ extends Control var tuto_speech: AudioStreamMP3 var feedback_speech: AudioStreamMP3 -var is_speaking: bool = false : +var is_speaking: bool = false: set(value): is_speaking = value elapsed_time = 0 @@ -35,7 +35,7 @@ func _process(delta: float) -> void: if elapsed_time > 20: start_speech() -func _play_speech(speech : AudioStream) -> void: +func _play_speech(speech: AudioStream) -> void: if not speech: Logger.warn("Kalulu: Speech not found") is_speaking = false diff --git a/sources/menus/main/language_field.gd b/sources/menus/main/language_field.gd index f2d836b5..9c473fe3 100644 --- a/sources/menus/main/language_field.gd +++ b/sources/menus/main/language_field.gd @@ -1,6 +1,6 @@ extends OptionButton -var items : Array[String] = [] +var items: Array[String] = [] func _ready() -> void: # Adds the supported locales to the field @@ -9,7 +9,7 @@ func _ready() -> void: if not language_locale: continue - var language_locale_name : String = TranslationServer.get_locale_name(language_locale) + var language_locale_name: String = TranslationServer.get_locale_name(language_locale) if not language_locale_name: continue diff --git a/sources/menus/main/login.gd b/sources/menus/main/login.gd index eed9fd5c..478146ee 100644 --- a/sources/menus/main/login.gd +++ b/sources/menus/main/login.gd @@ -2,13 +2,13 @@ extends Control signal logged_in -@onready var validator : FormValidator = %LoginFormValidator -@onready var email_field : LineEdit = %EmailField -@onready var password_field : LineEdit = %PasswordField -@onready var login_message : Label = %LoginError +@onready var validator: FormValidator = %LoginFormValidator +@onready var email_field: LineEdit = %EmailField +@onready var password_field: LineEdit = %PasswordField +@onready var login_message: Label = %LoginError -@onready var device_id_container : VBoxContainer = %DeviceIDContainer -@onready var device_id_field : SpinBox = %DeviceIDField +@onready var device_id_container: VBoxContainer = %DeviceIDContainer +@onready var device_id_field: SpinBox = %DeviceIDField func _ready() -> void: diff --git a/sources/menus/main/main_menu.gd b/sources/menus/main/main_menu.gd index 5a3defe5..93708040 100644 --- a/sources/menus/main/main_menu.gd +++ b/sources/menus/main/main_menu.gd @@ -5,9 +5,9 @@ const KALULU: = preload("res://sources/menus/main/kalulu.gd") const ADULT_CHECK_SCENE_PATH: String = "res://sources/menus/adult_check/adult_check.tscn" const PACKAGE_LOADER_SCENE_PATH: String = "res://sources/menus/language_selection/package_downloader.tscn" -@onready var version_label : Label = $Informations/BuildVersionValue -@onready var teacher_label : Label = $Informations/TeacherValue -@onready var device_id_label : Label = $Informations/DeviceIDValue +@onready var version_label: Label = $Informations/BuildVersionValue +@onready var teacher_label: Label = $Informations/TeacherValue +@onready var device_id_label: Label = $Informations/DeviceIDValue @onready var kalulu: KALULU = $Kalulu @onready var play_button: Button = %PlayButton diff --git a/sources/menus/register/progress_bar.gd b/sources/menus/register/progress_bar.gd index b84d280a..9cdc637c 100644 --- a/sources/menus/register/progress_bar.gd +++ b/sources/menus/register/progress_bar.gd @@ -1,5 +1,5 @@ extends ProgressBar class_name RegisterProgressBar -func set_value_with_tween(new_value : float) -> void: +func set_value_with_tween(new_value: float) -> void: create_tween().tween_property(self, "value", new_value, 0.15).set_trans(Tween.TRANS_LINEAR) diff --git a/sources/menus/register/register.gd b/sources/menus/register/register.gd index 337af54e..4d7eda99 100644 --- a/sources/menus/register/register.gd +++ b/sources/menus/register/register.gd @@ -56,14 +56,14 @@ func _go_to_step(step_index: int) -> void: progress_bar.set_value_with_tween(step_index) -func _on_step_back(_step : Step) -> void: +func _on_step_back(_step: Step) -> void: if progress_bar.value == 0: get_tree().change_scene_to_file(MAIN_MENU_PATH) else: _go_to_step(int(progress_bar.value-1)) -func _on_step_completed(step : Step) -> void: +func _on_step_completed(step: Step) -> void: match step.step_name: "type": # Adds teacher or parent steps @@ -81,7 +81,7 @@ func _on_step_completed(step : Step) -> void: for device: int in register_data.devices_count: var students_step_scene: Node = students_step.instantiate() if students_step_scene is StudentsCountStep: - (students_step_scene as StudentsCountStep).question = tr((students_step_scene as StudentsCountStep).question).format({"number" : (device + 1)}) + (students_step_scene as StudentsCountStep).question = tr((students_step_scene as StudentsCountStep).question).format({"number": (device + 1)}) (students_step_scene as StudentsCountStep).device_id = device + 1 current_steps.append(students_step_scene) else: @@ -95,7 +95,7 @@ func _on_step_completed(step : Step) -> void: var student_count: int = 1 for student: StudentData in register_data.students[1]: var student_step_scene: Step = player_step.instantiate() - student_step_scene.question = tr(student_step_scene.question).format({"number" : student_count}) + student_step_scene.question = tr(student_step_scene.question).format({"number": student_count}) student_step_scene.data = student current_steps.append(student_step_scene) student_count += 1 diff --git a/sources/menus/register/steps/base_step.gd b/sources/menus/register/steps/base_step.gd index 84f85a83..c508258e 100644 --- a/sources/menus/register/steps/base_step.gd +++ b/sources/menus/register/steps/base_step.gd @@ -2,18 +2,18 @@ extends Control class_name Step -signal back(step : Step) -signal next(step : Step) +signal back(step: Step) +signal next(step: Step) -@onready var question_label : Label = %QuestionLabel -@onready var info_label : Label = %InfoLabel -@onready var form_validator : FormValidator = %FormValidator -@onready var form_binder : FormBinder = %FormBinder -@onready var form_container : Control = %FormContainer +@onready var question_label: Label = %QuestionLabel +@onready var info_label: Label = %InfoLabel +@onready var form_validator: FormValidator = %FormValidator +@onready var form_binder: FormBinder = %FormBinder +@onready var form_container: Control = %FormContainer -@export var step_name : String -@export_multiline var question : String -@export_multiline var infos : String +@export var step_name: String +@export_multiline var question: String +@export_multiline var infos: String @export var data: Resource func on_enter() -> void: diff --git a/sources/menus/register/steps/device_recap.gd b/sources/menus/register/steps/device_recap.gd index 6fd0edf8..d6c16066 100644 --- a/sources/menus/register/steps/device_recap.gd +++ b/sources/menus/register/steps/device_recap.gd @@ -16,7 +16,7 @@ func _ready() -> void: var index: int = 1 for student: StudentData in students: - var student_panel : StudentPanel = STUDENT_PANEL_SCENE.instantiate() + var student_panel: StudentPanel = STUDENT_PANEL_SCENE.instantiate() student_panel.student_count = index student_panel.student_data = student students_container.add_child(student_panel) diff --git a/sources/menus/register/steps/general_conditions_step.gd b/sources/menus/register/steps/general_conditions_step.gd index 05147a34..1b858073 100644 --- a/sources/menus/register/steps/general_conditions_step.gd +++ b/sources/menus/register/steps/general_conditions_step.gd @@ -1,9 +1,9 @@ @tool extends Step -@onready var conditions_label : RichTextLabel = %ConditionsLabel -@onready var accept : CheckBox = %Accept -@onready var accept_error : Label = %AcceptError +@onready var conditions_label: RichTextLabel = %ConditionsLabel +@onready var accept: CheckBox = %Accept +@onready var accept_error: Label = %AcceptError func _on_back() -> bool: diff --git a/sources/menus/register/steps/recap_step.gd b/sources/menus/register/steps/recap_step.gd index 61ee7399..e5eb4bcb 100644 --- a/sources/menus/register/steps/recap_step.gd +++ b/sources/menus/register/steps/recap_step.gd @@ -18,30 +18,30 @@ func on_enter() -> void: if not teacher_settings: return - email.text = tr("SUMMARY_EMAIL").format({"mail" : teacher_settings.email}) - account_type.text = tr("SUMMARY_TYPE").format({"type" : tr((TeacherSettings.AccountType.keys()[teacher_settings.account_type] as String).to_upper())}) + email.text = tr("SUMMARY_EMAIL").format({"mail": teacher_settings.email}) + account_type.text = tr("SUMMARY_TYPE").format({"type": tr((TeacherSettings.AccountType.keys()[teacher_settings.account_type] as String).to_upper())}) if teacher_settings.account_type == TeacherSettings.AccountType.Teacher: - education_method.text = tr("SUMMARY_METHOD").format({"method" : tr((TeacherSettings.EducationMethod.keys()[teacher_settings.education_method] as String).to_upper())}) + education_method.text = tr("SUMMARY_METHOD").format({"method": tr((TeacherSettings.EducationMethod.keys()[teacher_settings.education_method] as String).to_upper())}) education_method.show() - students_count.text = tr("SUMMARY_NUMBER_OF_STUDENTS").format({"number" : teacher_settings.get_number_of_students()}) + students_count.text = tr("SUMMARY_NUMBER_OF_STUDENTS").format({"number": teacher_settings.get_number_of_students()}) students_count.show() else: education_method.hide() students_count.hide() - devices_count.text = tr("SUMMARY_NUMBER_OF_DEVICES").format({"number" : teacher_settings.students.size()}) + devices_count.text = tr("SUMMARY_NUMBER_OF_DEVICES").format({"number": teacher_settings.students.size()}) devices_count.show() for child: Node in recap_container.get_children(false): child.queue_free() for device: int in teacher_settings.students.keys(): - var device_recap : DeviceRecap = DEVICE_RECAP_SCENE.instantiate() + var device_recap: DeviceRecap = DEVICE_RECAP_SCENE.instantiate() if teacher_settings.account_type == TeacherSettings.AccountType.Teacher: - device_recap.title = tr("DEVICE_NUMBER").format({"number" : device}) + device_recap.title = tr("DEVICE_NUMBER").format({"number": device}) else: device_recap.title = tr("PLAYERS") device_recap.students = teacher_settings.students[device] diff --git a/sources/menus/register/steps/teacher/students_count_step.gd b/sources/menus/register/steps/teacher/students_count_step.gd index 63043143..93698044 100644 --- a/sources/menus/register/steps/teacher/students_count_step.gd +++ b/sources/menus/register/steps/teacher/students_count_step.gd @@ -2,7 +2,7 @@ extends Step class_name StudentsCountStep -@export var device_id : int +@export var device_id: int @onready var students_count_field: SpinBox = %StudentsCountField func _on_back() -> bool: diff --git a/sources/menus/settings/device_tab.gd b/sources/menus/settings/device_tab.gd index 6102f353..6d4e1b35 100644 --- a/sources/menus/settings/device_tab.gd +++ b/sources/menus/settings/device_tab.gd @@ -22,7 +22,7 @@ func refresh() -> void: if not students: return - var student_count : int = 1 + var student_count: int = 1 for student: StudentData in students: var student_panel: StudentPanel = STUDENT_PANEL_SCENE.instantiate() student_panel.student_count = student_count diff --git a/sources/menus/settings/lesson_unlocks.gd b/sources/menus/settings/lesson_unlocks.gd index ea338c66..2c2f227d 100644 --- a/sources/menus/settings/lesson_unlocks.gd +++ b/sources/menus/settings/lesson_unlocks.gd @@ -57,7 +57,7 @@ func _on_student_changed(value: int)-> void: _create_lessons() (%PasswordVisualizer as PasswordVisualizer).password = str(value) var all_students: Array = UserDataManager.teacher_settings.students[device] - for student_data : StudentData in all_students: + for student_data: StudentData in all_students: if student_data.code == value: name_line_edit.text = student_data.name break diff --git a/sources/menus/settings/student_panel.gd b/sources/menus/settings/student_panel.gd index bc857a48..60d8d4f4 100644 --- a/sources/menus/settings/student_panel.gd +++ b/sources/menus/settings/student_panel.gd @@ -3,11 +3,11 @@ class_name StudentPanel signal pressed -@onready var name_label : Label = %NameLabel -@onready var password_visualizer : PasswordVisualizer = %PasswordVisualizer +@onready var name_label: Label = %NameLabel +@onready var password_visualizer: PasswordVisualizer = %PasswordVisualizer -@export var student_count : int -@export var student_data : StudentData +@export var student_count: int +@export var student_data: StudentData func _ready() -> void: if not student_data: @@ -16,7 +16,7 @@ func _ready() -> void: if student_data.name: name_label.text = student_data.name else: - name_label.text = tr("STUDENT_NUM").format({"number" : student_count}) + name_label.text = tr("STUDENT_NUM").format({"number": student_count}) if student_data.code: password_visualizer.password = str(student_data.code) diff --git a/sources/menus/settings/teacher_settings.gd b/sources/menus/settings/teacher_settings.gd index d486c22e..1543f617 100644 --- a/sources/menus/settings/teacher_settings.gd +++ b/sources/menus/settings/teacher_settings.gd @@ -7,7 +7,7 @@ const DEVICE_SELECTION_SCENE_PATH: String = "res://sources/menus/device_selectio const DEVICE_TAB_SCENE: PackedScene = preload("res://sources/menus/settings/device_tab.tscn") -@onready var devices_tab_container : TabContainer = %DevicesTabContainer +@onready var devices_tab_container: TabContainer = %DevicesTabContainer @onready var lesson_unlocks: LessonUnlocks = $LessonUnlocks @onready var delete_popup: ConfirmPopup = %DeletePopup @onready var loading_popup: LoadingPopup = %LoadingPopup @@ -84,7 +84,7 @@ func refresh_devices_tabs() -> void: await get_tree().process_frame # Not optional or an auto-rename bug will occur on the tabs (especiallly if there are a lot of them) device_tab.device_id = device device_tab.students = UserDataManager.teacher_settings.students[device] - device_tab.name = tr("DEVICE_NUMBER").format({"number" : device}) + device_tab.name = tr("DEVICE_NUMBER").format({"number": device}) device_tab.student_pressed.connect(_on_student_pressed) device_tab.refresh() @@ -135,7 +135,7 @@ func _on_add_student_popup_accepted() -> void: if not current_tab: Logger.error("SettingsTeacherSettings: DeviceTab not found") return - var res: Dictionary = await ServerManager.add_student({"device" : current_tab.device_id}) + var res: Dictionary = await ServerManager.add_student({"device": current_tab.device_id}) if res.code == 200: UserDataManager.update_configuration(res.body as Dictionary) current_tab.students = UserDataManager.teacher_settings.students[current_tab.device_id] @@ -149,7 +149,7 @@ func _on_add_device_button_pressed() -> void: func _on_add_device_popup_accepted() -> void: - var res: Dictionary = await ServerManager.add_student({"device" : last_device_id + 1}) + var res: Dictionary = await ServerManager.add_student({"device": last_device_id + 1}) if res.code == 200: UserDataManager.update_configuration(res.body as Dictionary) refresh_devices_tabs() diff --git a/sources/minigames/base/base_minigame.gd b/sources/minigames/base/base_minigame.gd index a4cb5241..0307d86e 100644 --- a/sources/minigames/base/base_minigame.gd +++ b/sources/minigames/base/base_minigame.gd @@ -24,11 +24,11 @@ enum Type { @export var minigame_number: int = 1 @export_category("Difficulty") -@export var max_number_of_lives: int = 0 : +@export var max_number_of_lives: int = 0: set(value): max_number_of_lives = value -@export var max_progression: int = 0 : +@export var max_progression: int = 0: set(value): max_progression = value if minigame_ui: @@ -68,7 +68,7 @@ var stimuli: Array = [] var distractions: Array = [] # Lives -var current_lives: int = 0 : +var current_lives: int = 0: set(value): var previous_lives: int = current_lives current_lives = value @@ -82,7 +82,7 @@ var current_lives: int = 0 : is_highlighting = true # Progression -var current_progression: int = 0 : set = set_current_progression +var current_progression: int = 0: set = set_current_progression var current_number_of_hints: int = 0 var consecutive_errors: int = 0 var is_highlighting: bool = false: diff --git a/sources/minigames/base/hear_and_find/syllables_minigame.gd b/sources/minigames/base/hear_and_find/syllables_minigame.gd index c4ef723a..d9536813 100644 --- a/sources/minigames/base/hear_and_find/syllables_minigame.gd +++ b/sources/minigames/base/hear_and_find/syllables_minigame.gd @@ -2,13 +2,13 @@ extends Minigame class_name SyllablesMinigame -signal stimulus_heard(is_heard : bool) +signal stimulus_heard(is_heard: bool) signal stimulus_found() # Time before a new stimulus when the previous one is found -@export var between_stimuli_time : float = 2. +@export var between_stimuli_time: float = 2. # Time before the current stimulus is repeated -@export var stimulus_repeat_time : float = 15 +@export var stimulus_repeat_time: float = 15 @onready var stimulus_timer: Timer = $StimulusTimer @@ -69,13 +69,13 @@ func _find_stimuli_and_distractions() -> void: # If there are not enough stimuli from current lesson, we want at least half the target number of stimuli @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: while stimuli.size() < minimal_stimuli: stimuli.append(current_lesson_stimuli.pick_random()) # Gets other stimuli from previous errors or lessons - var spaces_left : int = max_progression - stimuli.size() + var spaces_left: int = max_progression - stimuli.size() if previous_lesson_stimuli.size() >= spaces_left: for index: int in spaces_left: stimuli.append(previous_lesson_stimuli[index]) @@ -146,7 +146,7 @@ func _is_stimulus_found() -> bool: return true -func _is_stimulus_right(stimulus : Dictionary) -> bool: +func _is_stimulus_right(stimulus: Dictionary) -> bool: var current_stimulus: Dictionary = _get_current_stimulus() return stimulus == current_stimulus @@ -165,7 +165,7 @@ func _play_current_stimulus_phoneme() -> void: stimulus_timer.start() -func _await_for_future_or_stimulus_found(future : Signal) -> bool: +func _await_for_future_or_stimulus_found(future: Signal) -> bool: var coroutine: Coroutine = Coroutine.new() coroutine.add_future(_is_stimulus_found) coroutine.add_future(future) @@ -179,7 +179,7 @@ func _await_for_future_or_stimulus_found(future : Signal) -> bool: # ------------ Connections ------------ -func _on_stimulus_pressed(stimulus : Dictionary, _node : Node) -> bool: +func _on_stimulus_pressed(stimulus: Dictionary, _node: Node) -> bool: if not is_stimulus_heard: return false diff --git a/sources/minigames/caterpillar/caterpillar.gd b/sources/minigames/caterpillar/caterpillar.gd index 4f3e053f..09acd670 100644 --- a/sources/minigames/caterpillar/caterpillar.gd +++ b/sources/minigames/caterpillar/caterpillar.gd @@ -27,7 +27,7 @@ func walk() -> void: body_part.walk() -func move(distance : float) -> void: +func move(distance: float) -> void: if is_moving or is_eating: return @@ -105,7 +105,7 @@ func eat_berry(berry: Berry) -> void: func spit_berry(berry: Berry) -> void: is_eating = true - var pos_x : float = berry.global_position.x + var pos_x: float = berry.global_position.x # Eat the berry var tween: Tween = create_tween() diff --git a/sources/minigames/caterpillar/spit_fx.gd b/sources/minigames/caterpillar/spit_fx.gd index be20a571..7cec093a 100644 --- a/sources/minigames/caterpillar/spit_fx.gd +++ b/sources/minigames/caterpillar/spit_fx.gd @@ -1,7 +1,7 @@ extends Control class_name SpitVFX -@onready var particles : GPUParticles2D = $Particles +@onready var particles: GPUParticles2D = $Particles func play() -> void: particles.amount = randi_range(5, 8) diff --git a/sources/minigames/crabs/hole/hole.gd b/sources/minigames/crabs/hole/hole.gd index 570e4daf..7b63e091 100644 --- a/sources/minigames/crabs/hole/hole.gd +++ b/sources/minigames/crabs/hole/hole.gd @@ -150,7 +150,7 @@ func wrong() -> void: crab.wrong() -func _set_crab_button_active(is_active : bool) -> void: +func _set_crab_button_active(is_active: bool) -> void: if crab: crab.set_button_active(is_active) @@ -182,7 +182,7 @@ func _on_crab_hit(stimulus: Dictionary) -> void: crab = null -func on_stimulus_heard(is_heard : bool) -> void: +func on_stimulus_heard(is_heard: bool) -> void: stimulus_heard = is_heard diff --git a/sources/minigames/jellyfish/jellyfish_minigame.tscn b/sources/minigames/jellyfish/jellyfish_minigame.tscn index 6a52b4e4..022f3c5f 100644 --- a/sources/minigames/jellyfish/jellyfish_minigame.tscn +++ b/sources/minigames/jellyfish/jellyfish_minigame.tscn @@ -4,7 +4,7 @@ [ext_resource type="Script" uid="uid://b5own5tlvbofc" path="res://sources/minigames/jellyfish/jellyfish_minigame.gd" id="2_gnjlp"] [ext_resource type="Texture2D" uid="uid://c0shai0eqdrbf" path="res://assets/minigames/jellyfish/graphic/gauge_icon_jellyfish_empty.png" id="4_1m7js"] [ext_resource type="Texture2D" uid="uid://cq87j1xw4c31r" path="res://assets/minigames/jellyfish/graphic/gauge_icon_jellyfish_full.png" id="5_4gwjw"] -[ext_resource type="Texture2D" uid="uid://c7oq86cgq7okn" path="res://assets/minigames/jellyfish/graphic/backgroung.png" id="6_sn7hv"] +[ext_resource type="Texture2D" uid="uid://c7oq86cgq7okn" path="res://assets/minigames/jellyfish/graphic/background.png" id="6_sn7hv"] [node name="JellyfishMinigame" instance=ExtResource("1_hauef")] script = ExtResource("2_gnjlp") diff --git a/sources/utils/autoloads/database.gd b/sources/utils/autoloads/database.gd index b956886f..5f95039c 100644 --- a/sources/utils/autoloads/database.gd +++ b/sources/utils/autoloads/database.gd @@ -2,12 +2,12 @@ extends Node const _SYMBOLS_TO_STRING: Dictionary[String, String] = { - "#" : "sharp", - "@" : "at", - "*" : "star", - "$" : "usd", - "%" : "pcent", - "§" : "para" + "#": "sharp", + "@": "at", + "*": "star", + "$": "usd", + "%": "pcent", + "§": "para" } const BASE_PATH: String = "user://language_resources/" const TRACING_DATA_FOLDER: String = "tracing_data/" @@ -80,7 +80,7 @@ func load_additional_word_list() -> String: return "" -func get_exercice_for_lesson(lesson_nb: int) -> Array[int]: +func get_exercise_for_lesson(lesson_nb: int) -> Array[int]: var query: String = "Select Exercise1, Exercise2, Exercise3 FROM LessonsExercises INNER JOIN Lessons ON Lessons.ID = LessonsExercises.LessonID WHERE LessonNB == " + str(lesson_nb) diff --git a/sources/utils/autoloads/logger.gd b/sources/utils/autoloads/logger.gd index bf8655df..f397e7b0 100644 --- a/sources/utils/autoloads/logger.gd +++ b/sources/utils/autoloads/logger.gd @@ -111,11 +111,11 @@ func _log_to_file(message: String) -> void: log_file.flush() # Sugar functions -# trace can be used everywhere, in ordre to have a full log of all that is hapenning +# trace can be used everywhere, in order to have a full log of all that is hapenning func trace(msg: String) -> void: _log_internal(LogLevel.TRACE, msg) # debug should only be used in a dev environment to track a specific bug. func debug(msg: String) -> void: _log_internal(LogLevel.DEBUG, msg) -# info can carry important informations that should always be logged but that are not problematic +# info can carry important information(s) that should always be logged but that are not problematic func info(msg: String) -> void: _log_internal(LogLevel.INFO, msg) func warn(msg: String) -> void: _log_internal(LogLevel.WARNING, msg) func error(msg: String) -> void: _log_internal(LogLevel.ERROR, msg) diff --git a/sources/utils/autoloads/music_manager.gd b/sources/utils/autoloads/music_manager.gd index 55ef9090..98797426 100644 --- a/sources/utils/autoloads/music_manager.gd +++ b/sources/utils/autoloads/music_manager.gd @@ -1,6 +1,6 @@ extends Node -@onready var music_player : AudioStreamPlayer = $MusicPlayer +@onready var music_player: AudioStreamPlayer = $MusicPlayer const TRACKS: Array = [ preload("res://assets/music/title.mp3"), @@ -19,7 +19,7 @@ func _on_music_player_finished() -> void: music_player.stream_paused = false music_player.play() -func play(track : Track) -> void: +func play(track: Track) -> void: music_player.stream = TRACKS[track] music_player.play() diff --git a/sources/utils/autoloads/opening_curtain.gd b/sources/utils/autoloads/opening_curtain.gd index 91442bed..b1b23b32 100644 --- a/sources/utils/autoloads/opening_curtain.gd +++ b/sources/utils/autoloads/opening_curtain.gd @@ -5,7 +5,7 @@ signal animation_finished(animation_name: StringName) @onready var animation_player: AnimationPlayer = $AnimationPlayer -var is_closed : bool = false +var is_closed: bool = false func open() -> void: if is_closed: diff --git a/sources/utils/autoloads/server_manager.gd b/sources/utils/autoloads/server_manager.gd index 036da560..0d57cd6f 100644 --- a/sources/utils/autoloads/server_manager.gd +++ b/sources/utils/autoloads/server_manager.gd @@ -38,7 +38,7 @@ func first_login_student() -> void: func check_email(email: String) -> Dictionary: loading_rect.show() - await _get_request("checkemail", {"mail" : email}) + await _get_request("checkemail", {"mail": email}) return _response() @@ -99,9 +99,7 @@ func update_student_remediation_data(student_code: int, student_remediation: Use await _post_json_request("submit_gp_remediation", data) return _response() -# p_student must have a device key -# it can contain a name, level and age key for parents -# TODO POUR ADD / UPDATE / REMOVE STUDENT : RECUPERER LE TIMESTAMP POUR METTRE A JOUR LE USER + func add_student(p_student: Dictionary) -> Dictionary: await _post_request("add_student", p_student) return _response() @@ -151,7 +149,7 @@ func _create_request_headers(content_type_json: bool = false) -> PackedStringArr headers.append("Authorization: Bearer " + teacher_settings.token) if content_type_json: headers.append("Content-Type: application/json") - Logger.trace("ServerManager Create Header : " + str(headers)) + Logger.trace("ServerManager Create Header: " + str(headers)) return headers @@ -162,9 +160,9 @@ var json: Dictionary = {} func _response() -> Dictionary: var res: Dictionary = { - "success" : success, - "code" : code, - "body" : json + "success": success, + "code": code, + "body": json } return res diff --git a/sources/utils/autoloads/user_data_manager.gd b/sources/utils/autoloads/user_data_manager.gd index 7e1aa01e..c0526bbf 100644 --- a/sources/utils/autoloads/user_data_manager.gd +++ b/sources/utils/autoloads/user_data_manager.gd @@ -2,11 +2,11 @@ extends Node -var student: String = "" : +var student: String = "": set(student_name): student = student_name student_progression = null - if student : + if student: _load_student_progression() _load_student_remediation() _load_student_difficulty() @@ -134,14 +134,14 @@ func login(infos: Dictionary) -> bool: func safe_load_and_fix_resource(path: String, old_texts: Array[String], new_texts: Array[String]) -> Resource: if not FileAccess.file_exists(path): - Logger.error("❌ File not found : " + path) + Logger.error("UserDataManager: File not found: " + path) return null var content: String = FileAccess.get_file_as_string(path) for index: int in old_texts.size(): if content.find(old_texts[index]) != -1: - Logger.info("🔧 Fix resource:" + path) + Logger.info("UserDataManager: Fix resource:" + path) content = content.replace(old_texts[index], new_texts[index]) var file: FileAccess = FileAccess.open(path, FileAccess.WRITE) file.store_string(content) @@ -149,9 +149,11 @@ func safe_load_and_fix_resource(path: String, old_texts: Array[String], new_text var resource: Resource = ResourceLoader.load(path) if resource == null: - push_error("❌ Chargement échoué même après correction : " + path) + #TODO REPLACE WITH LOGGER + push_error("UserDataManager: Loading failed after correction: " + path) else: - print("✅ Chargement réussi :", path) + #TODO REPLACE WITH LOGGER + print("UserDataManager: Loading success: " + path) return resource func set_device_id(device: int) -> bool: @@ -183,7 +185,7 @@ func delete_teacher_data() -> void: if DirAccess.dir_exists_absolute(get_teacher_folder()): _delete_dir(get_teacher_folder()) -func login_student(code : String) -> bool: +func login_student(code: String) -> bool: if not _device_settings or not teacher_settings: return false @@ -230,7 +232,7 @@ func _save_device_settings() -> void: Logger.trace("UserDataManager: Saving device settings in " + get_device_settings_path()) ResourceSaver.save(_device_settings, get_device_settings_path()) -func set_language(language : String) -> void: +func set_language(language: String) -> void: if _device_settings: _device_settings.language = language _save_device_settings() @@ -312,7 +314,7 @@ func denormalize_volume(value: float) -> float: func get_teacher_folder() -> String: return "user://".path_join(_device_settings.teacher) -func _get_teacher_settings_path(teacher : String) -> String: +func _get_teacher_settings_path(teacher: String) -> String: return "user://".path_join(teacher).path_join("teacher_settings.tres") func get_teacher_settings_path() -> String: diff --git a/sources/utils/binder/control_binder.gd b/sources/utils/binder/control_binder.gd index db8d0b09..814a24fe 100644 --- a/sources/utils/binder/control_binder.gd +++ b/sources/utils/binder/control_binder.gd @@ -2,7 +2,7 @@ extends Control class_name ControlBinder -@export var property_name : String +@export var property_name: String var control: Control diff --git a/sources/utils/binder/form_binder.gd b/sources/utils/binder/form_binder.gd index 943abe3e..bab28029 100644 --- a/sources/utils/binder/form_binder.gd +++ b/sources/utils/binder/form_binder.gd @@ -2,7 +2,7 @@ extends Control class_name FormBinder -@export var data : Resource +@export var data: Resource var _control_binder_map: Dictionary[Control, ControlBinder] = {} diff --git a/sources/utils/fx/highlight.gd b/sources/utils/fx/highlight.gd index 8f31f642..79799b0a 100644 --- a/sources/utils/fx/highlight.gd +++ b/sources/utils/fx/highlight.gd @@ -4,7 +4,7 @@ class_name HighlightFX @onready var animation_player: AnimationPlayer = $AnimationPlayer -var is_playing : bool = false +var is_playing: bool = false func play() -> void: is_playing = true diff --git a/sources/utils/fx/sand.gd b/sources/utils/fx/sand.gd index 745a71d0..37644e96 100644 --- a/sources/utils/fx/sand.gd +++ b/sources/utils/fx/sand.gd @@ -12,10 +12,10 @@ const TEXTURES: Array[CompressedTexture2D] = [ preload("res://assets/vfx/sand_07.png") ] -@onready var particles : GPUParticles2D = $Particles -@onready var timer : Timer = $Timer +@onready var particles: GPUParticles2D = $Particles +@onready var timer: Timer = $Timer -var is_playing : bool = false +var is_playing: bool = false func _ready() -> void: timer.wait_time = particles.lifetime diff --git a/sources/utils/minigame_resources/log.gd b/sources/utils/minigame_resources/log.gd index 7d141cb5..7b8e4ef6 100644 --- a/sources/utils/minigame_resources/log.gd +++ b/sources/utils/minigame_resources/log.gd @@ -1,7 +1,7 @@ extends Resource class_name LogResource -@export var logs: Dictionary = {} # int : Dictionary {String : Dictionary} +@export var logs: Dictionary = {} # int: Dictionary {String: Dictionary} func add_log(lesson_nb: int, new_log: Dictionary, time: String) -> void: diff --git a/sources/utils/swipe_detector.gd b/sources/utils/swipe_detector.gd index b795a246..ab9a31c3 100644 --- a/sources/utils/swipe_detector.gd +++ b/sources/utils/swipe_detector.gd @@ -8,7 +8,7 @@ signal swipe(start_position: Vector2, end_position: Vector2) var current_preview: TextureRect var start_position: Vector2 -func _ready() -> void : +func _ready() -> void: set_drag_forwarding( # _get_drag_data func(at_position: Vector2) -> Dictionary: