Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the settings system #136

Open
PureTryOut opened this issue Sep 10, 2021 · 0 comments
Open

Refactor the settings system #136

PureTryOut opened this issue Sep 10, 2021 · 0 comments
Labels
enhancement New feature or request medium The difficulty of this issue is medium

Comments

@PureTryOut
Copy link
Collaborator

Currently the settings are read on startup https://github.com/Lea-fish/Leafish/blob/main/src/main.rs#L217 and then passed along through the entire application. This works but is complicated and annoying, you don't want to pass such a global thing around everywhere. It would instead be nice to be able to do settings::get(<setting>) to get the value, from anywhere in the code.

For example settings::get(auth::CL_USERNAME) should return you the username used.

Also currently the settings reading and saving is done inside src/console/mod.rs which seems like the wrong place to do such a thing. Instead that should focus entirely on the console of the game, and let the settings module do it's work itself.

@PureTryOut PureTryOut added enhancement New feature or request medium The difficulty of this issue is medium labels Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium The difficulty of this issue is medium
Projects
None yet
Development

No branches or pull requests

1 participant