mtd/Scripts/graphics_options.gd

36 lines
951 B
GDScript3
Raw Normal View History

2024-02-22 06:22:22 +11:00
class_name GraphicsOptionsMenu extends VBoxContainer
2024-02-22 06:22:22 +11:00
@export var fov_input: SpinBox
@export var fov_slider: HSlider
@export var vsync_dropdown: OptionButton
@export var aa_dropdown: OptionButton
@export var window_dropdown: OptionButton
2024-02-22 06:22:22 +11:00
func _ready() -> void:
fov_input.value = Data.graphics.hfov
fov_slider.value = Data.graphics.hfov
vsync_dropdown.selected = Data.graphics.vsync_mode
aa_dropdown.selected = Data.graphics.aa_mode
2024-02-22 06:22:22 +11:00
func save() -> void:
Data.graphics.hfov = fov_slider.value
Data.graphics.vsync_mode = vsync_dropdown.selected
Data.graphics.aa_mode = aa_dropdown.selected
Data.graphics.windowed_mode = window_dropdown.selected
func _on_fov_spin_box_value_changed(value: float) -> void:
if value < 40.0:
value = 40.0
if value > 160.0:
value = 160.0
fov_slider.value = value
Data.graphics.hfov = value
func _on_fov_h_slider_value_changed(value: float) -> void:
fov_input.value = value
Data.graphics.hfov = value