🎨 Auto-format GDScript code

Automated formatting applied by tools/run_development.py

🤖 Generated by Gitea Actions
Workflow: Continuous Integration
Run: http://server:3000/nett00n/skelly/actions/runs/90
This commit is contained in:
Gitea Actions
2025-10-01 11:05:19 +00:00
parent 3b8da89ad5
commit 1f1c394587
28 changed files with 655 additions and 1945 deletions

View File

@@ -9,10 +9,8 @@ const YAML_SOURCES: Array[String] = [
# "res://assets/sprites/sprite-sources.yaml",
]
@onready
var scroll_container: ScrollContainer = $MarginContainer/VBoxContainer/ScrollContainer
@onready
var credits_text: RichTextLabel = $MarginContainer/VBoxContainer/ScrollContainer/CreditsText
@onready var scroll_container: ScrollContainer = $MarginContainer/VBoxContainer/ScrollContainer
@onready var credits_text: RichTextLabel = $MarginContainer/VBoxContainer/ScrollContainer/CreditsText
@onready var back_button: Button = $MarginContainer/VBoxContainer/BackButton
@@ -42,9 +40,7 @@ func _load_yaml_file(yaml_path: String) -> Dictionary:
var file := FileAccess.open(yaml_path, FileAccess.READ)
if not file:
DebugManager.log_warn(
"Could not open YAML file: %s" % yaml_path, "Credits"
)
DebugManager.log_warn("Could not open YAML file: %s" % yaml_path, "Credits")
return {}
var content: String = file.get_as_text()
@@ -71,18 +67,10 @@ func _parse_yaml_content(yaml_content: String) -> Dictionary:
continue
# Top-level section (audio, sprites, textures, etc.)
if (
not line.begins_with(" ")
and not line.begins_with("\t")
and trimmed.ends_with(":")
):
if not line.begins_with(" ") and not line.begins_with("\t") and trimmed.ends_with(":"):
if current_asset and not current_asset_data.is_empty():
_store_asset_data(
result,
current_section,
current_subsection,
current_asset,
current_asset_data
result, current_section, current_subsection, current_asset, current_asset_data
)
current_section = trimmed.trim_suffix(":")
current_subsection = ""
@@ -92,37 +80,22 @@ func _parse_yaml_content(yaml_content: String) -> Dictionary:
result[current_section] = {}
# Subsection (music, sfx, characters, etc.)
elif (
line.begins_with(" ")
and not line.begins_with(" ")
and trimmed.ends_with(":")
):
elif line.begins_with(" ") and not line.begins_with(" ") and trimmed.ends_with(":"):
if current_asset and not current_asset_data.is_empty():
_store_asset_data(
result,
current_section,
current_subsection,
current_asset,
current_asset_data
result, current_section, current_subsection, current_asset, current_asset_data
)
current_subsection = trimmed.trim_suffix(":")
current_asset = ""
current_asset_data = {}
if (
current_section
and not result[current_section].has(current_subsection)
):
if current_section and not result[current_section].has(current_subsection):
result[current_section][current_subsection] = {}
# Asset name
elif trimmed.begins_with('"') and trimmed.contains('":'):
if current_asset and not current_asset_data.is_empty():
_store_asset_data(
result,
current_section,
current_subsection,
current_asset,
current_asset_data
result, current_section, current_subsection, current_asset, current_asset_data
)
var parts: Array = trimmed.split('"')
current_asset = parts[1] if parts.size() > 1 else ""
@@ -133,31 +106,21 @@ func _parse_yaml_content(yaml_content: String) -> Dictionary:
var parts: Array = trimmed.split(":", false, 1)
if parts.size() == 2:
var key: String = parts[0].strip_edges()
var value: String = (
parts[1].strip_edges().trim_prefix('"').trim_suffix('"')
)
var value: String = parts[1].strip_edges().trim_prefix('"').trim_suffix('"')
if value and value != '""':
current_asset_data[key] = value
# Store last asset
if current_asset and not current_asset_data.is_empty():
_store_asset_data(
result,
current_section,
current_subsection,
current_asset,
current_asset_data
result, current_section, current_subsection, current_asset, current_asset_data
)
return result
func _store_asset_data(
result: Dictionary,
section: String,
subsection: String,
asset: String,
data: Dictionary
result: Dictionary, section: String, subsection: String, asset: String, data: Dictionary
) -> void:
"""Store parsed asset data into result dictionary"""
if not section or not asset:
@@ -187,9 +150,7 @@ func _merge_credits_data(target: Dictionary, source: Dictionary) -> void:
func _display_formatted_credits(credits_data: Dictionary) -> void:
"""Generate BBCode formatted credits from parsed data"""
if not credits_text:
DebugManager.log_error(
"Credits text node is null, cannot display credits", "Credits"
)
DebugManager.log_error("Credits text node is null, cannot display credits", "Credits")
return
var credits_bbcode: String = "[center][b][font_size=32]CREDITS[/font_size][/b][/center]\n\n"
@@ -266,17 +227,11 @@ func _on_back_button_pressed() -> void:
func _input(event: InputEvent) -> void:
if (
event.is_action_pressed("ui_back")
or event.is_action_pressed("action_east")
):
if event.is_action_pressed("ui_back") or event.is_action_pressed("action_east"):
_on_back_button_pressed()
elif event.is_action_pressed("move_up") or event.is_action_pressed("ui_up"):
_scroll_credits(-50.0)
elif (
event.is_action_pressed("move_down")
or event.is_action_pressed("ui_down")
):
elif event.is_action_pressed("move_down") or event.is_action_pressed("ui_down"):
_scroll_credits(50.0)
@@ -284,6 +239,4 @@ func _scroll_credits(amount: float) -> void:
"""Scroll the credits by the specified amount"""
var current_scroll: float = scroll_container.scroll_vertical
scroll_container.scroll_vertical = int(current_scroll + amount)
DebugManager.log_debug(
"Scrolled credits to: %d" % scroll_container.scroll_vertical, "Credits"
)
DebugManager.log_debug("Scrolled credits to: %d" % scroll_container.scroll_vertical, "Credits")