27 lines
943 B
GDScript3
27 lines
943 B
GDScript3
|
|
# options_menu.gd (Nur an den Control-Knoten anhängen!)
|
||
|
|
extends Control
|
||
|
|
|
||
|
|
@onready var fullscreen_toggle: CheckBox = $VBoxContainer/FullscreenCheckButton
|
||
|
|
@onready var resolution_dropdown: OptionButton = $VBoxContainer/ResolutionOptionButton
|
||
|
|
|
||
|
|
func _ready() -> void:
|
||
|
|
# Dropdown-Werte initialisieren
|
||
|
|
resolution_dropdown.add_item("1920x1080", 0)
|
||
|
|
resolution_dropdown.add_item("1280x720", 1)
|
||
|
|
|
||
|
|
# Signale verbinden
|
||
|
|
resolution_dropdown.item_selected.connect(_on_resolution_selected)
|
||
|
|
fullscreen_toggle.toggled.connect(_on_fullscreen_toggled)
|
||
|
|
|
||
|
|
func _on_fullscreen_toggled(button_pressed: bool) -> void:
|
||
|
|
# Delegation der Aufgabe an den Autoload
|
||
|
|
SettingsManager.set_fullscreen(button_pressed)
|
||
|
|
|
||
|
|
func _on_resolution_selected(index: int) -> void:
|
||
|
|
match index:
|
||
|
|
0: SettingsManager.set_resolution(1920, 1080)
|
||
|
|
1: SettingsManager.set_resolution(1280, 720)
|
||
|
|
|
||
|
|
func _on_settings_pressed() -> void:
|
||
|
|
get_tree().change_scene_to_file("uid://bbjstb404m82i")
|