🎨 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

@@ -30,25 +30,17 @@ var is_highlighted: bool = false
func _ready() -> void:
DebugManager.log_info(
"ValueStepper ready for: " + data_source, "ValueStepper"
)
DebugManager.log_info("ValueStepper ready for: " + data_source, "ValueStepper")
# Store original visual properties
original_scale = scale
original_modulate = modulate
# Connect button signals
if (
left_button
and not left_button.pressed.is_connected(_on_left_button_pressed)
):
if left_button and not left_button.pressed.is_connected(_on_left_button_pressed):
left_button.pressed.connect(_on_left_button_pressed)
if (
right_button
and not right_button.pressed.is_connected(_on_right_button_pressed)
):
if right_button and not right_button.pressed.is_connected(_on_right_button_pressed):
right_button.pressed.connect(_on_right_button_pressed)
# Initialize data
@@ -66,9 +58,7 @@ func _load_data() -> void:
"difficulty":
_load_difficulty_data()
_:
DebugManager.log_warn(
"Unknown data_source: " + data_source, "ValueStepper"
)
DebugManager.log_warn("Unknown data_source: " + data_source, "ValueStepper")
func _load_language_data() -> void:
@@ -78,30 +68,22 @@ func _load_language_data() -> void:
display_names.clear()
for lang_code in languages_data.languages.keys():
values.append(lang_code)
display_names.append(
languages_data.languages[lang_code]["display_name"]
)
display_names.append(languages_data.languages[lang_code]["display_name"])
# Set current index based on current language
var current_lang: String = SettingsManager.get_setting("language")
var index: int = values.find(current_lang)
current_index = max(0, index)
DebugManager.log_info(
"Loaded %d languages" % values.size(), "ValueStepper"
)
DebugManager.log_info("Loaded %d languages" % values.size(), "ValueStepper")
func _load_resolution_data() -> void:
# Example resolution data - customize as needed
values = ["1920x1080", "1366x768", "1280x720", "1024x768"]
display_names = [
"1920×1080 (Full HD)", "1366×768", "1280×720 (HD)", "1024×768"
]
display_names = ["1920×1080 (Full HD)", "1366×768", "1280×720 (HD)", "1024×768"]
current_index = 0
DebugManager.log_info(
"Loaded %d resolutions" % values.size(), "ValueStepper"
)
DebugManager.log_info("Loaded %d resolutions" % values.size(), "ValueStepper")
func _load_difficulty_data() -> void:
@@ -109,18 +91,12 @@ func _load_difficulty_data() -> void:
values = ["easy", "normal", "hard", "nightmare"]
display_names = ["Easy", "Normal", "Hard", "Nightmare"]
current_index = 1 # Default to "normal"
DebugManager.log_info(
"Loaded %d difficulty levels" % values.size(), "ValueStepper"
)
DebugManager.log_info("Loaded %d difficulty levels" % values.size(), "ValueStepper")
## Updates the display text based on current selection
func _update_display() -> void:
if (
values.size() == 0
or current_index < 0
or current_index >= values.size()
):
if values.size() == 0 or current_index < 0 or current_index >= values.size():
value_display.text = "N/A"
return
@@ -133,9 +109,7 @@ func _update_display() -> void:
## Changes the current value by the specified direction (-1 for previous, +1 for next)
func change_value(direction: int) -> void:
if values.size() == 0:
DebugManager.log_warn(
"No values available for: " + data_source, "ValueStepper"
)
DebugManager.log_warn("No values available for: " + data_source, "ValueStepper")
return
var new_index: int = (current_index + direction) % values.size()
@@ -149,14 +123,7 @@ func change_value(direction: int) -> void:
_apply_value_change(new_value, current_index)
value_changed.emit(new_value, current_index)
DebugManager.log_info(
(
"Value changed to: "
+ new_value
+ " (index: "
+ str(current_index)
+ ")"
),
"ValueStepper"
"Value changed to: " + new_value + " (index: " + str(current_index) + ")", "ValueStepper"
)
@@ -169,14 +136,10 @@ func _apply_value_change(new_value: String, _index: int) -> void:
LocalizationManager.change_language(new_value)
"resolution":
# Apply resolution change logic here
DebugManager.log_info(
"Resolution would change to: " + new_value, "ValueStepper"
)
DebugManager.log_info("Resolution would change to: " + new_value, "ValueStepper")
"difficulty":
# Apply difficulty change logic here
DebugManager.log_info(
"Difficulty would change to: " + new_value, "ValueStepper"
)
DebugManager.log_info("Difficulty would change to: " + new_value, "ValueStepper")
## Sets up custom values for the stepper
@@ -185,24 +148,16 @@ func setup_custom_values(
) -> void:
values = custom_values.duplicate()
display_names = (
custom_display_names.duplicate()
if custom_display_names.size() > 0
else values.duplicate()
custom_display_names.duplicate() if custom_display_names.size() > 0 else values.duplicate()
)
current_index = 0
_update_display()
DebugManager.log_info(
"Setup custom values: " + str(values.size()) + " items", "ValueStepper"
)
DebugManager.log_info("Setup custom values: " + str(values.size()) + " items", "ValueStepper")
## Gets the current value
func get_current_value() -> String:
if (
values.size() > 0
and current_index >= 0
and current_index < values.size()
):
if values.size() > 0 and current_index >= 0 and current_index < values.size():
return values[current_index]
return ""