Settings window
Posted: July 1st, 2017, 7:20 pm
I've added code for a Settings window to this fork:
https://github.com/EndeavourAccuracy/SDLPoP
It's a work-in-progress and still partially non-functional. Basically, you mouse click the main window and a Settings window shows up. Changes in the "live" column are meant to update the game on-the-fly (in real-time), and changes in the "INI" column are meant to be saved with the "Save" button. I'm hoping Falcury will help me out with some things, I'll mention below. For some other things David's knowledge of the code base and SDL may be helpful.
Some issues that maybe David could look into:
- For some reason Alt+F4 (or clicking the close cross) no longer works.
- Clicking the main window again should (and does) hide the Settings window, but making the Settings window visible again - for some reason - requires two clicks. I don't understand why.
Falcury, where it says "TODO: Save all settings" could you make it save all the INI settings to sPathFile. (sPathFile is already either SDLPoP.ini or mod.ini.) Of course there's no hurry, we're all busy with our jobs and such. I'm asking you because you've worked with/created the 'INI system' and are familiar with related variable names.
[Edit: I mean literally all INI settings, not just what is currently available on the Settings window.]
Also, some variables, such as "enable_controller_rumble", should be split in two. One variable should be used to store the value that was read from the INI file, and one variable should copy that value to be used by the actual game. This will allow the Settings window to both change on-the-fly and keep track of INI settings. For several variables this is already happening, e.g. "start_minutes_left" (INI) and "rem_min" (live).
Keeping all the above in mind, the options currently available on the Settings window already provide some functionality to make real-time changes. It's just that for the game pad rumble, changing the INI setting impacts the live settings and vice versa, minutes left is only visible when pressing Space in-game, and hit points left is limited by the max HP and the game only updates the indicators after taking damage.
I think I've done a proper job making the code flexible enough to easily add additional options to modify. Plus the Settings window already has 7 tabs, that, overall, should provide a fair amount of space for these options.
https://github.com/EndeavourAccuracy/SDLPoP
It's a work-in-progress and still partially non-functional. Basically, you mouse click the main window and a Settings window shows up. Changes in the "live" column are meant to update the game on-the-fly (in real-time), and changes in the "INI" column are meant to be saved with the "Save" button. I'm hoping Falcury will help me out with some things, I'll mention below. For some other things David's knowledge of the code base and SDL may be helpful.
Some issues that maybe David could look into:
- For some reason Alt+F4 (or clicking the close cross) no longer works.
- Clicking the main window again should (and does) hide the Settings window, but making the Settings window visible again - for some reason - requires two clicks. I don't understand why.
Falcury, where it says "TODO: Save all settings" could you make it save all the INI settings to sPathFile. (sPathFile is already either SDLPoP.ini or mod.ini.) Of course there's no hurry, we're all busy with our jobs and such. I'm asking you because you've worked with/created the 'INI system' and are familiar with related variable names.
[Edit: I mean literally all INI settings, not just what is currently available on the Settings window.]
Also, some variables, such as "enable_controller_rumble", should be split in two. One variable should be used to store the value that was read from the INI file, and one variable should copy that value to be used by the actual game. This will allow the Settings window to both change on-the-fly and keep track of INI settings. For several variables this is already happening, e.g. "start_minutes_left" (INI) and "rem_min" (live).
Keeping all the above in mind, the options currently available on the Settings window already provide some functionality to make real-time changes. It's just that for the game pad rumble, changing the INI setting impacts the live settings and vice versa, minutes left is only visible when pressing Space in-game, and hit points left is limited by the max HP and the game only updates the indicators after taking damage.
I think I've done a proper job making the code flexible enough to easily add additional options to modify. Plus the Settings window already has 7 tabs, that, overall, should provide a fair amount of space for these options.