option_buttons.gd 683 B

12345678910111213141516171819202122
  1. extends Control
  2. @onready var render_distance_label = $RenderDistanceLabel
  3. @onready var render_distance_slider = $RenderDistanceSlider
  4. @onready var fog_checkbox: CheckBox = $FogCheckBox
  5. func _ready():
  6. render_distance_slider.value = Settings.render_distance
  7. render_distance_label.text = "Render distance: " + str(Settings.render_distance)
  8. fog_checkbox.button_pressed = Settings.fog_enabled
  9. func _on_RenderDistanceSlider_value_changed(value):
  10. Settings.render_distance = value
  11. render_distance_label.text = "Render distance: " + str(value)
  12. Settings.save_settings()
  13. func _on_FogCheckBox_pressed():
  14. Settings.fog_enabled = fog_checkbox.button_pressed
  15. Settings.save_settings()