MrEliptik / godot_twitch_games

Collection of small chat interactive games for Twitch
https://bento.me/mreliptik
MIT License
16 stars 5 forks source link

autoload game config manager #77

Closed Drathal closed 10 months ago

Drathal commented 10 months ago

closes #76

Refactor of game config manager to be an autoload. In the ticket it states we only need save_config, but we want to apply configs. So for now we need a load_config

To load the config, put the next line into _ready. This will load and if possible apply the config.

GameConfigManager.load_config()

To save the config put the next line where you want to save the config. At the moment we have it whenever we close a game scene hit ESC key.

GameConfigManager.save_config()

At the moment the following configs have a function bound to it:

window_position
window_size

After this i would create a ticket to also save custom config for the game. So that we can do this:

GameConfigManager.save_config({ "max_players": 10 })

The game can then persist whatever config it needs. load_config can then return this values