config.gd 381 B

1234567891011121314151617
  1. extends Node
  2. const FILE_NAME = "user://config.ini"
  3. @onready var content: ConfigFile = ConfigFile.new()
  4. var show_tutorial: bool:
  5. set(new_value):
  6. content.set_value("general", "show_tutorial", new_value)
  7. get:
  8. return content.get_value("general", "show_tutorial", true)
  9. func _ready() -> void:
  10. content.load("user://config.ini")
  11. func save() -> void:
  12. content.save(FILE_NAME)