diff --git a/addons/EnvironmentSwitcher/environment_switcher.gd b/addons/EnvironmentSwitcher/environment_switcher.gd index bdf415f2..e8bcccf0 100644 --- a/addons/EnvironmentSwitcher/environment_switcher.gd +++ b/addons/EnvironmentSwitcher/environment_switcher.gd @@ -3,7 +3,7 @@ extends EditorPlugin enum EnvType { DEV, PROD } -const CONFIG_PATH := "user://environment.cfg" +const CONFIG_PATH: String = "user://environment.cfg" var env_selector: OptionButton var current_environment: EnvType = EnvType.DEV diff --git a/addons/export_tool_manager/export_tool_manager_plugin.gd b/addons/export_tool_manager/export_tool_manager_plugin.gd index 30c188dc..4cb988ec 100644 --- a/addons/export_tool_manager/export_tool_manager_plugin.gd +++ b/addons/export_tool_manager/export_tool_manager_plugin.gd @@ -93,4 +93,4 @@ func export_all_game_presets(): ]) return else: - print("✔ Export success : %s → %s" % [preset_name, output_path]) + print("✔ Export success: %s → %s" % [preset_name, output_path]) diff --git a/addons/godot-form-validator/form_validator.gd b/addons/godot-form-validator/form_validator.gd index d68d04e5..553efd19 100644 --- a/addons/godot-form-validator/form_validator.gd +++ b/addons/godot-form-validator/form_validator.gd @@ -41,7 +41,7 @@ func validate() -> bool: for info: ValidatorInfo in list: if info.validator.skip_validation: continue - var control := info.control as Control + var control: Control = info.control as Control if control == null: Logger.error("FormValidator: ValidatorInfo.control is not a Control: %s" % [info.control]) continue @@ -60,7 +60,7 @@ func validate() -> bool: func _get_validator_info_list() -> Array[ValidatorInfo]: var list: Array[ValidatorInfo] = [] for controlKey in _control_validator_map.keys(): - var control := controlKey as Control + var control: Control = controlKey as Control if control == null: Logger.error("FormValidator: _control_validator_map key is not a Control") continue diff --git a/resources/device_settings.gd b/resources/device_settings.gd index 5ca9d6a0..4ea93462 100644 --- a/resources/device_settings.gd +++ b/resources/device_settings.gd @@ -16,35 +16,35 @@ const SUPPORTED_LOCALES: Array[String] = [ "pt_BR" ] -@export var language : String : +@export var language: String: set(value): language = value Database.language = value TranslationServer.set_locale(value) print("DeviceSettings: language SET: " + TranslationServer.get_locale()) -@export var teacher : String -@export var device_id : int +@export var teacher: String +@export var device_id: int @export var language_versions: Dictionary = {} # locale : datetime -@export var master_volume: float = 0.0 : +@export var master_volume: float = 0.0: set(volume): master_volume = volume var ind: int = AudioServer.get_bus_index("Master") AudioServer.set_bus_volume_db(ind, volume) -@export var music_volume: float = 0.0 : +@export var music_volume: float = 0.0: set(volume): music_volume = volume var ind: int = AudioServer.get_bus_index("Music") AudioServer.set_bus_volume_db(ind, volume) -@export var voice_volume: float = 0.0 : +@export var voice_volume: float = 0.0: set(volume): voice_volume = volume var ind: int = AudioServer.get_bus_index("Voice") AudioServer.set_bus_volume_db(ind, volume) -@export var effects_volume: float = 0.0 : +@export var effects_volume: float = 0.0: set(volume): effects_volume = volume var ind: int = AudioServer.get_bus_index("Effects") diff --git a/resources/user/teacher_settings.gd b/resources/user/teacher_settings.gd index e09ac61f..29f8926e 100644 --- a/resources/user/teacher_settings.gd +++ b/resources/user/teacher_settings.gd @@ -88,7 +88,7 @@ func update_student_device(student_code: int, new_student_device: int) -> void: Logger.warn("TeacherSettings: update_student_device: student not found with code " + str(student_code)) -func get_new_code() -> int : +func get_new_code() -> int: var used_codes: Array[int] = [] for student_array: Array[StudentData] in students.values(): for student: StudentData in student_array: diff --git a/sources/menus/main/main_menu.gd b/sources/menus/main/main_menu.gd index 468cf478..5a3defe5 100644 --- a/sources/menus/main/main_menu.gd +++ b/sources/menus/main/main_menu.gd @@ -9,9 +9,9 @@ const PACKAGE_LOADER_SCENE_PATH: String = "res://sources/menus/language_selectio @onready var teacher_label : Label = $Informations/TeacherValue @onready var device_id_label : Label = $Informations/DeviceIDValue -@onready var kalulu : KALULU = $Kalulu +@onready var kalulu: KALULU = $Kalulu @onready var play_button: Button = %PlayButton -@onready var interface_left : MarginContainer = %InterfaceLeft +@onready var interface_left: MarginContainer = %InterfaceLeft @onready var keyboard_spacer: KeyboardSpacer = %KeyboardSpacer @onready var no_internet_popup: ConfirmPopup = $NoInternetPopup diff --git a/sources/minigames/base/words/words_minigame.gd b/sources/minigames/base/words/words_minigame.gd index 4305d5c0..2bdc887c 100644 --- a/sources/minigames/base/words/words_minigame.gd +++ b/sources/minigames/base/words/words_minigame.gd @@ -55,13 +55,13 @@ func _find_stimuli_and_distractions() -> void: stimuli.append_array(current_lesson_words) # If there are not enough stimuli from current lesson, we want at least half the target number of stimuli - var minimal_stimuli : int = floori(current_lesson_stimuli_number/2.0) + var minimal_stimuli: int = floori(current_lesson_stimuli_number/2.0) if stimuli.size() < minimal_stimuli: while stimuli.size() < minimal_stimuli: stimuli.append(current_lesson_words.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_words.size() >= spaces_left: for index: int in spaces_left: stimuli.append(previous_lesson_words[index]) diff --git a/sources/minigames/caterpillar/branch.gd b/sources/minigames/caterpillar/branch.gd index 105cd9c8..0838bf9f 100644 --- a/sources/minigames/caterpillar/branch.gd +++ b/sources/minigames/caterpillar/branch.gd @@ -51,7 +51,7 @@ func _process(delta: float) -> void: func spawn_berry(gp: Dictionary, is_distractor: bool) -> void: - var berry : Berry = BERRY_SCENE.instantiate() + var berry: Berry = BERRY_SCENE.instantiate() berries.add_child(berry) berry.gp = gp berry.is_distractor = is_distractor diff --git a/sources/minigames/crabs/crab/crab.gd b/sources/minigames/crabs/crab/crab.gd index c9d9164e..8e9403de 100644 --- a/sources/minigames/crabs/crab/crab.gd +++ b/sources/minigames/crabs/crab/crab.gd @@ -91,9 +91,9 @@ func _on_button_pressed() -> void: func _on_animated_sprite_2d_animation_finished() -> void: match animated_sprite.animation: "idle1", "idle2": - if randf() < 0.5 : + if randf() < 0.5: animated_sprite.play("idle1") - else : + else: animated_sprite.play("idle2") "hit": animated_sprite.play("hurt") diff --git a/sources/minigames/crabs/crabs_minigame.gd b/sources/minigames/crabs/crabs_minigame.gd index 59f16bfe..1c6f7de5 100644 --- a/sources/minigames/crabs/crabs_minigame.gd +++ b/sources/minigames/crabs/crabs_minigame.gd @@ -129,7 +129,7 @@ func _spawn_crabs() -> void: await get_tree().create_timer(0.1).timeout -func _on_hole_crab_out(hole : Hole) -> void: +func _on_hole_crab_out(hole: Hole) -> void: if is_highlighting and _is_stimulus_right(hole.crab.stimulus): hole.highlight() @@ -158,7 +158,7 @@ func _on_hole_timer_timeout() -> void: stimulus_spawned = true holes[index].spawn_crab(_get_current_stimulus(), true) else: - var current_distractors : Array = distractions[current_progression % distractions.size()] + var current_distractors: Array = distractions[current_progression % distractions.size()] holes[index].spawn_crab(current_distractors.pick_random() as Dictionary, false) hole_found = true break diff --git a/sources/minigames/crabs/hole/hole.gd b/sources/minigames/crabs/hole/hole.gd index face201e..570e4daf 100644 --- a/sources/minigames/crabs/hole/hole.gd +++ b/sources/minigames/crabs/hole/hole.gd @@ -16,7 +16,7 @@ const CRAB_SCENE: PackedScene = preload("res://sources/minigames/crabs/crab/crab @onready var crab_audio_stream_player: HoleAudioStreamPlayer = $CrabAudioStreamPlayer2D var crab: Crab -var crab_x : float +var crab_x: float var stimulus_heard: bool = false: set(value): stimulus_heard = value @@ -28,7 +28,7 @@ var crab_visible: bool = false: var is_stimulus: bool = false -func _process(_delta : float) -> void: +func _process(_delta: float) -> void: if not crab: if sand_vfx.is_playing: sand_vfx.stop() @@ -111,7 +111,7 @@ func spawn_crab(gp: Dictionary, p_is_stimulus: bool) -> void: crab_despawned.emit(p_is_stimulus) -func is_button_pressed_with_limit(future : Signal) -> bool: +func is_button_pressed_with_limit(future: Signal) -> bool: var coroutine: Coroutine = Coroutine.new() coroutine.add_future(crab.is_button_pressed) coroutine.add_future(_is_stopped) diff --git a/sources/minigames/jellyfish/jellyfish_minigame.gd b/sources/minigames/jellyfish/jellyfish_minigame.gd index 1288d836..5b0bdfb3 100644 --- a/sources/minigames/jellyfish/jellyfish_minigame.gd +++ b/sources/minigames/jellyfish/jellyfish_minigame.gd @@ -60,7 +60,7 @@ func _stop_highlight() -> void: func _spawn() -> void: # Instantiate a new jellyfish - var new_jellyfish : Jellyfish = JELLYFISH_SCENE.instantiate() + var new_jellyfish: Jellyfish = JELLYFISH_SCENE.instantiate() spawning_space.add_child(new_jellyfish) # Find the right size for the jellyfish @@ -85,7 +85,7 @@ func _spawn() -> void: if is_highlighting: new_jellyfish.highlight() else: - var current_distractors : Array = distractions[current_progression % distractions.size()] + var current_distractors: Array = distractions[current_progression % distractions.size()] new_jellyfish.stimulus = current_distractors.pick_random() # Randomize the spawn and adds the jellyfish into the scene diff --git a/sources/minigames/monkeys/coconut.gd b/sources/minigames/monkeys/coconut.gd index edd16ed2..11228367 100644 --- a/sources/minigames/monkeys/coconut.gd +++ b/sources/minigames/monkeys/coconut.gd @@ -6,7 +6,7 @@ class_name Coconut @onready var label: Label = $Label @onready var broken_coconut_fx: BrokenCoconutFX = $BrokenCoconutFX -var text: String : +var text: String: set(value): text = value if label: diff --git a/sources/minigames/parakeets/parakeets_minigame.gd b/sources/minigames/parakeets/parakeets_minigame.gd index 1a1fd391..ea35aa92 100644 --- a/sources/minigames/parakeets/parakeets_minigame.gd +++ b/sources/minigames/parakeets/parakeets_minigame.gd @@ -46,11 +46,11 @@ var selected: Array[Parakeet] = [] var state: State = State.Locked const DIFFICULTY_SETTINGS: Dictionary[int, Dictionary] = { - 0 : {"pairs_count": 2}, - 1 : {"pairs_count": 3}, - 2 : {"pairs_count": 4}, - 3 : {"pairs_count": 5}, - 4 : {"pairs_count": 6}, + 0: {"pairs_count": 2}, + 1: {"pairs_count": 3}, + 2: {"pairs_count": 4}, + 3: {"pairs_count": 5}, + 4: {"pairs_count": 6}, } diff --git a/sources/minigames/penguin/penguin_minigame.gd b/sources/minigames/penguin/penguin_minigame.gd index adac05c0..df2dd68a 100644 --- a/sources/minigames/penguin/penguin_minigame.gd +++ b/sources/minigames/penguin/penguin_minigame.gd @@ -46,13 +46,13 @@ func _find_stimuli_and_distractions() -> void: stimuli.append_array(current_lesson_sentences) # If there are not enough stimuli from current lesson, we want at least half the target number of stimuli - var minimal_stimuli : int = floori(current_lesson_stimuli_number/2.0) + var minimal_stimuli: int = floori(current_lesson_stimuli_number/2.0) if stimuli.size() < minimal_stimuli: while stimuli.size() < minimal_stimuli: stimuli.append(current_lesson_sentences.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_sentences.size() >= spaces_left: for index: int in spaces_left: stimuli.append(previous_lesson_sentences[index]) diff --git a/sources/minigames/turtles/island.gd b/sources/minigames/turtles/island.gd index edf76f33..5e5b4d7d 100644 --- a/sources/minigames/turtles/island.gd +++ b/sources/minigames/turtles/island.gd @@ -1,7 +1,7 @@ extends Area2D class_name Island -@onready var label : Label = $Label +@onready var label: Label = $Label @onready var collision: CollisionPolygon2D = $CollisionPolygon2D var stimulus: Dictionary = {}: diff --git a/sources/minigames/turtles/turtle.gd b/sources/minigames/turtles/turtle.gd index ba79e901..d64b8a98 100644 --- a/sources/minigames/turtles/turtle.gd +++ b/sources/minigames/turtles/turtle.gd @@ -40,7 +40,7 @@ func _set_direction(new_direction: Vector2) -> void: is_changing_direction = true # Get the angle difference between the old and new direction - var angle_to : float = rad_to_deg(direction.angle_to(new_direction)) + var angle_to: float = rad_to_deg(direction.angle_to(new_direction)) # Calculate the new angle of the body - this allows to get the closest angle for tweening var angle: float = body.rotation_degrees + rad_to_deg(direction.angle_to(new_direction)) diff --git a/sources/utils/autoloads/server_manager.gd b/sources/utils/autoloads/server_manager.gd index 2ae85639..036da560 100644 --- a/sources/utils/autoloads/server_manager.gd +++ b/sources/utils/autoloads/server_manager.gd @@ -87,7 +87,7 @@ func get_user_data() -> Dictionary: func update_student_remediation_data(student_code: int, student_remediation: UserRemediation) -> Dictionary: if not student_remediation: - Logger.trace("ServerManager: Cannot update studient remediation data because data does not exists") + Logger.trace("ServerManager: Cannot update student remediation data because data does not exists") success = true code = -1 json = {} diff --git a/sources/utils/autoloads/user_database_synchronizer.gd b/sources/utils/autoloads/user_database_synchronizer.gd index ced36087..1beedb76 100644 --- a/sources/utils/autoloads/user_database_synchronizer.gd +++ b/sources/utils/autoloads/user_database_synchronizer.gd @@ -289,7 +289,7 @@ func _apply_server_response(response_body: Dictionary) -> void: var new_scores: Dictionary[int, int] = {} for index: int in new_array.size(): # TODO ADD SECURITY - new_scores[int(new_array[index][0])] = int(new_array[index][1]) + new_scores[int(new_array[index][0] as float)] = int(new_array[index][1] as float) UserDataManager.set_student_remediation_data(int(response_student_code), new_scores, response_student_data.remediation_gp.updated_at as String)