laamaa / m8c

Cross-platform M8 tracker headless client
Other
409 stars 85 forks source link

Added basic config handling. #19

Closed JeffAlyanak closed 3 years ago

JeffAlyanak commented 3 years ago

Still work to do on this before it's really workable for all the settings required, but this at least gets things working.

It uses an MIT licensed library for simple INI reading and supports writing, so GUI options can later be added for writing the config.

Currently only supports the fullscreen option (see the included config.ini) which allows you to set the initial state of the application.

The config code should be pulled off into its own function for long-term cleanliness, but I wanted to get a pull request together and confer with @laamaa regarding whether this is the right type of config library for them before going past a prototype state.

laamaa commented 3 years ago

Looks good to me, feel free to go ahead. Could you please move the config handling stuff to its own files (as you suggested yourself) so that possible new config parameters wouldn't clutter main.c. I wonder if it also would be a good idea to have the parameters inside a struct?

JeffAlyanak commented 3 years ago

Looks good to me, feel free to go ahead. Could you please move the config handling stuff to its own files (as you suggested yourself) so that possible new config parameters wouldn't clutter main.c. I wonder if it also would be a good idea to have the parameters inside a struct?

Yeah, that's exactly what I was thinking! That'll ensure that it stays nice and clean even as new config params are added.

JeffAlyanak commented 3 years ago

@laamaa

I've moved the code off into it's own files and turned the config into a struct as discussed.

I've also had to replace the case statements for the keyboard and gamepad inputs to allow for user configurable inputs.

laamaa commented 3 years ago

Great job! Thank you :) This also fixes #1