saumwacht-godot/scripts/luneraria/ui/lune_settings.gd
Martin Stickelbroeck c27a0097c3 M1: spielbarer Drei-Lane-Kern mit Karte, HUD, Menü und Abnahme
Hauptszene scenes/luneraria.tscn, Saumwacht bleibt über --legacy und die
alten QA-Schalter erreichbar. Karte aus Bestandsassets plus neuem Turm,
HUD mit Planung, Lanes und Minimap, Menü umbenannt, Einstellungen werden
aus dem alten Benutzerordner übernommen. Simulation 6,6x schneller
(Raster, Caches, faire Staffelung) und exakt spiegelsymmetrisch.
Regeln 91/91, echte Anwendung 38/38, Legacy unverändert grün.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 21:37:23 +02:00

68 lines
2.8 KiB
GDScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class_name LuneSettings
extends ColorRect
## Options and controls for Champions of Luneraria; the same Preferences as before.
signal closed
var _volume: HSlider
var _checks: Dictionary = {}
func _ready() -> void:
theme = SaumwachtTheme.shared()
color = Color(.02, .03, .04, .9)
set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
mouse_filter = Control.MOUSE_FILTER_STOP
var center := CenterContainer.new()
center.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
add_child(center)
var panel := PanelContainer.new()
panel.theme_type_variation = "MenuPanel"
panel.custom_minimum_size.x = 760
center.add_child(panel)
var column := VBoxContainer.new()
column.add_theme_constant_override("separation", 12)
panel.add_child(column)
var heading := _label("Optionen & Steuerung", "HeadingLabel", column)
heading.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
_label("Ein laufender Kampf pausiert, solange dieses Fenster geöffnet ist.", "MutedLabel", column).horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
_label("LAUTSTÄRKE", "SectionLabel", column)
_volume = HSlider.new()
_volume.max_value = 100
_volume.custom_minimum_size.y = 28
column.add_child(_volume)
_volume.value_changed.connect(func(value: float) -> void:
Preferences.volume = value / 100.0
Preferences.commit())
var grid := GridContainer.new()
grid.columns = 2
grid.add_theme_constant_override("h_separation", 28)
column.add_child(grid)
for entry: Array in [["muted", "Ton stumm [M]"], ["fullscreen", "Vollbild [F11]"], ["reduced_motion", "Bewegung reduzieren"]]:
var check := CheckButton.new()
check.text = entry[1]
grid.add_child(check)
var key: String = entry[0]
check.toggled.connect(func(value: bool) -> void:
Preferences.set(key, value)
Preferences.commit())
_checks[key] = check
column.add_child(HSeparator.new())
_label("STEUERUNG", "SectionLabel", column)
_label("Planung: 1–5 Truppe kaufen · Lane-Knöpfe T/M/B teilen ein · Leertaste Bereit\nKampf: Leertaste oder P Pause · Tempo 1×/2×/4× · Kämpfe laufen automatisch\nKamera: WASD / Pfeile / mittlere Maustaste · Mausrad Zoom · Tab nächste Lane · O Übersicht\nMinimap anklicken springt dorthin · F1 Optionen · M Ton · F11 Vollbild", "Label", column)
var back := Button.new()
back.text = "ZURÜCK [Esc]"
back.theme_type_variation = "PrimaryButton"
back.pressed.connect(func() -> void: closed.emit())
column.add_child(back)
func _label(text_value: String, variation: String, parent: Node) -> Label:
var label := Label.new()
label.text = text_value
label.theme_type_variation = variation
parent.add_child(label)
return label
func sync() -> void:
_volume.set_value_no_signal(Preferences.volume * 100.0)
for key: String in _checks:
(_checks[key] as CheckButton).set_pressed_no_signal(bool(Preferences.get(key)))