mtd/Scripts/options_menu.gd

27 lines
665 B
GDScript3
Raw Normal View History

2024-02-22 06:22:22 +11:00
class_name OptionsMenu extends Control
2024-02-22 06:22:22 +11:00
@export var gameplay: GameplayOptionsMenu
@export var graphics: GraphicsOptionsMenu
@export var keybinds: KeybindsOptionsMenu
2023-11-19 18:47:52 +11:00
func _on_cancel_pressed() -> void:
queue_free()
func _on_confirm_pressed() -> void:
2023-11-19 18:47:52 +11:00
gameplay.save()
graphics.save()
Data.graphics.apply_graphical_settings(get_viewport())
Data.graphics.save_profile_to_disk()
Data.audio.apply_audio_settings()
Data.audio.save_profile_to_disk()
Data.preferences.save_profile_to_disk()
Data.player_keymap.save_profile_to_disk()
2024-02-22 06:22:22 +11:00
Data.player_controller_keymap.append_input_map()
queue_free()
func _on_button_hovered() -> void:
$AudioStreamPlayer.play()