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:
@@ -75,7 +75,7 @@ func _get_node_animated() -> Node:
|
|||||||
func _search_button_to_use(counter: int) -> Node:
|
func _search_button_to_use(counter: int) -> Node:
|
||||||
if counter == 0:
|
if counter == 0:
|
||||||
return object_first.instantiate()
|
return object_first.instantiate()
|
||||||
elif counter == meshes.size() - 1:
|
if counter == meshes.size() - 1:
|
||||||
return object_last.instantiate()
|
return object_last.instantiate()
|
||||||
return object_std.instantiate()
|
return object_std.instantiate()
|
||||||
|
|
||||||
@@ -184,13 +184,13 @@ func _gyroscope_changed_right(gyroscope: Vector3) -> bool:
|
|||||||
func _gyroscope_changed_down(gyroscope: Vector3) -> bool:
|
func _gyroscope_changed_down(gyroscope: Vector3) -> bool:
|
||||||
return (gyroscope.abs().z - gyroscope_value_old.abs().z) > GYROSCOPE_MAX_DIFF and \
|
return (gyroscope.abs().z - gyroscope_value_old.abs().z) > GYROSCOPE_MAX_DIFF and \
|
||||||
gyroscope.z > gyroscope_value_old.z or \
|
gyroscope.z > gyroscope_value_old.z or \
|
||||||
(gyroscope.abs().x - gyroscope_value_old.abs().x) > GYROSCOPE_MAX_DIFF and \
|
(gyroscope.abs().x - gyroscope_value_old.abs().x) > GYROSCOPE_MAX_DIFF and \
|
||||||
gyroscope.x > gyroscope_value_old.x
|
gyroscope.x > gyroscope_value_old.x
|
||||||
|
|
||||||
func _gyroscope_changed_up(gyroscope: Vector3) -> bool:
|
func _gyroscope_changed_up(gyroscope: Vector3) -> bool:
|
||||||
return (gyroscope.abs().z - gyroscope_value_old.abs().z) > GYROSCOPE_MAX_DIFF and \
|
return (gyroscope.abs().z - gyroscope_value_old.abs().z) > GYROSCOPE_MAX_DIFF and \
|
||||||
gyroscope.z < gyroscope_value_old.z or \
|
gyroscope.z < gyroscope_value_old.z or \
|
||||||
(gyroscope.abs().x - gyroscope_value_old.abs().x) > GYROSCOPE_MAX_DIFF and \
|
(gyroscope.abs().x - gyroscope_value_old.abs().x) > GYROSCOPE_MAX_DIFF and \
|
||||||
gyroscope.x < gyroscope_value_old.x
|
gyroscope.x < gyroscope_value_old.x
|
||||||
|
|
||||||
func _start_dissolve(key: String) -> void:
|
func _start_dissolve(key: String) -> void:
|
||||||
|
|||||||
+5
-5
@@ -9,11 +9,6 @@ extends Node
|
|||||||
# (per-scene lock state) persists across runs.
|
# (per-scene lock state) persists across runs.
|
||||||
|
|
||||||
class DB extends RefCounted:
|
class DB extends RefCounted:
|
||||||
var settings: SettingsData
|
|
||||||
var levels: Array[LevelEntry] = []
|
|
||||||
var scenes: Array[SceneEntry] = []
|
|
||||||
var _path: String
|
|
||||||
|
|
||||||
const _SETTINGS_PROPS := [
|
const _SETTINGS_PROPS := [
|
||||||
{"name": "langue", "type": "1", "auto_increment": "0"},
|
{"name": "langue", "type": "1", "auto_increment": "0"},
|
||||||
{"name": "gyroscope", "type": "0", "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"},
|
{"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:
|
func _init(path: String) -> void:
|
||||||
_path = path
|
_path = path
|
||||||
var f := FileAccess.open(path, FileAccess.READ)
|
var f := FileAccess.open(path, FileAccess.READ)
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,6 @@ extends Control
|
|||||||
|
|
||||||
# Application root: async scene loading + reference to the loaded Database.
|
# 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: Node = null
|
||||||
var current_scene_int: int = -1
|
var current_scene_int: int = -1
|
||||||
var wait_frames: int = 1
|
var wait_frames: int = 1
|
||||||
@@ -11,6 +9,8 @@ var database: RefCounted = null
|
|||||||
var loaded: bool = false
|
var loaded: bool = false
|
||||||
var _loading_path: String = ""
|
var _loading_path: String = ""
|
||||||
|
|
||||||
|
@onready var animation: AnimationPlayer = Loading.get_node("AnimLoading")
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
database = load("res://scripts/Database.gd").new().initialize()
|
database = load("res://scripts/Database.gd").new().initialize()
|
||||||
_initialize_current_scene()
|
_initialize_current_scene()
|
||||||
|
|||||||
Reference in New Issue
Block a user