Fix 354 gdlint warnings across 65 files: 194 class-definitions-order (reorder declarations), 138 max-line-length (split long lines), 22 code issues (unused args, no-else-return, naming). Update .gdlintrc to exclude addons/ and raise max-public-methods for test files. No logic changes — declaration order, whitespace, and naming only. Ticket: #783 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
45 lines
1.3 KiB
GDScript
45 lines
1.3 KiB
GDScript
extends Control
|
|
## #257: Loading screen overlay — blocks input during save/load round-trip.
|
|
## Shown when LOAD_GAME fires; hidden when save_result arrives (success or failure).
|
|
## Full-screen, dark overlay with centered status text.
|
|
|
|
const BG_COLOR := Color(0.0, 0.0, 0.0, 0.75)
|
|
const TEXT_COLOR := Color("#c8d0e0")
|
|
const FONT_SIZE := 18
|
|
|
|
var _label: Label = null
|
|
|
|
|
|
func _ready() -> void:
|
|
visible = false
|
|
mouse_filter = Control.MOUSE_FILTER_STOP
|
|
set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
|
_build_ui()
|
|
|
|
|
|
func _build_ui() -> void:
|
|
var bg := ColorRect.new()
|
|
bg.color = BG_COLOR
|
|
bg.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
|
bg.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
|
add_child(bg)
|
|
|
|
_label = Label.new()
|
|
_label.text = UIStrings.get_text("notifications.loading")
|
|
_label.add_theme_font_size_override("font_size", FONT_SIZE)
|
|
_label.add_theme_color_override("font_color", TEXT_COLOR)
|
|
_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
|
_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
|
_label.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
|
_label.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
|
add_child(_label)
|
|
|
|
|
|
func show_loading() -> void:
|
|
visible = true
|
|
|
|
|
|
## Hide the loading overlay. success=false is reserved for future failure-state UI.
|
|
func hide_loading(_success: bool = true) -> void:
|
|
visible = false
|