1
0
Fork 0
mirror of https://github.com/tonytins/dressupzack synced 2025-05-05 13:34:48 -04:00
dressupzack/scripts/config.gd
Tony Bark 71dfa4d52f Imported some older sprites
- Scale window
- Full body clothes
- Config file for custom window size (game is tiny on my new display)
2024-01-16 11:48:49 -05:00

33 lines
801 B
GDScript

extends Node
func debug_config():
# If the game is in
if OS.is_debug_build():
return "res://config.cfg"
else:
return "user://config.cfg"
func set_config(config_file = "user://config.cfg"):
# Create new ConfigFile object.
var config = ConfigFile.new()
# Store some values.
config.set_value("window", "height", 1024)
config.set_value("window", "width", 768)
# Save it to a file (overwrite if already exists)
if !FileAccess.file_exists(config_file):
config.save(config_file)
func get_config(section, value, config_file = "user://config.cfg"):
var config = ConfigFile.new()
# Load data from a file.
var err = config.load(config_file)
# If the file didn't load, ignore it.
if err != OK:
return
for cfg in config.get_sections():
return config.get_value(section, value)