Fix gdlint findings in Global / Database / Levels

- Global.gd: move @onready var animation below the regular vars
  (gdlint class-definitions-order expects onready vars after
  public/private vars).
- Database.gd::DB: move the three _*_PROPS constants above the vars
  (constants come before vars in a class body).
- Levels.gd:_search_button_to_use: drop the elif after a branch
  that returns (no-elif-return).
- Levels.gd:_gyroscope_changed_{down,up}: continuation lines of the
  multi-line return mixed two tabs + three spaces; normalised to
  pure tabs.

No semantic change: @onready is property-level so source ordering
doesn't affect init; elif after a return is equivalent to if; the
continuation indent is cosmetic.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vaillant Jeremy
2026-05-17 14:48:20 +02:00
parent e883d662f2
commit 238fccef95
3 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ func _get_node_animated() -> Node:
func _search_button_to_use(counter: int) -> Node:
if counter == 0:
return object_first.instantiate()
elif counter == meshes.size() - 1:
if counter == meshes.size() - 1:
return object_last.instantiate()
return object_std.instantiate()
+5 -5
View File
@@ -9,11 +9,6 @@ extends Node
# (per-scene lock state) persists across runs.
class DB extends RefCounted:
var settings: SettingsData
var levels: Array[LevelEntry] = []
var scenes: Array[SceneEntry] = []
var _path: String
const _SETTINGS_PROPS := [
{"name": "langue", "type": "1", "auto_increment": "0"},
{"name": "gyroscope", "type": "0", "auto_increment": "0"},
@@ -36,6 +31,11 @@ class DB extends RefCounted:
{"name": "counter", "type": "1", "auto_increment": "0"},
]
var settings: SettingsData
var levels: Array[LevelEntry] = []
var scenes: Array[SceneEntry] = []
var _path: String
func _init(path: String) -> void:
_path = path
var f := FileAccess.open(path, FileAccess.READ)
+2 -2
View File
@@ -2,8 +2,6 @@ extends Control
# Application root: async scene loading + reference to the loaded Database.
@onready var animation: AnimationPlayer = Loading.get_node("AnimLoading")
var current_scene: Node = null
var current_scene_int: int = -1
var wait_frames: int = 1
@@ -11,6 +9,8 @@ var database: RefCounted = null
var loaded: bool = false
var _loading_path: String = ""
@onready var animation: AnimationPlayer = Loading.get_node("AnimLoading")
func _ready() -> void:
database = load("res://scripts/Database.gd").new().initialize()
_initialize_current_scene()