37 lines
1 KiB
GDScript3
37 lines
1 KiB
GDScript3
|
|
extends Control
|
||
|
|
|
||
|
|
@export var categories: ButtonGroup
|
||
|
|
|
||
|
|
@onready var options_container: OptionsContainer = %OptionsContainer
|
||
|
|
|
||
|
|
var gameplay_options: GameplayOptions = GameplayOptions.new()
|
||
|
|
var audio_options: AudioOptions = AudioOptions.new()
|
||
|
|
var display_options: DisplayOptions = DisplayOptions.new()
|
||
|
|
var control_options: ControlOptions = ControlOptions.new()
|
||
|
|
|
||
|
|
func change_options():
|
||
|
|
var button: Button = categories.get_pressed_button()
|
||
|
|
match button.text:
|
||
|
|
" Gameplay ":
|
||
|
|
print("gaming")
|
||
|
|
options_container.build(gameplay_options)
|
||
|
|
" Display ":
|
||
|
|
print("grafix")
|
||
|
|
options_container.build(display_options)
|
||
|
|
" Audio ":
|
||
|
|
print("whoaaa sound")
|
||
|
|
options_container.build(audio_options)
|
||
|
|
" Controls ":
|
||
|
|
print("control deez nuts")
|
||
|
|
options_container.build(control_options)
|
||
|
|
_:
|
||
|
|
print("bruh xd")
|
||
|
|
|
||
|
|
func _ready() -> void:
|
||
|
|
for button in categories.get_buttons():
|
||
|
|
button.pressed.connect(change_options)
|
||
|
|
%AcceptButton.pressed.connect(options_container.accept)
|
||
|
|
|
||
|
|
func _on_cancel_button_pressed() -> void:
|
||
|
|
self.visible = false
|