ui: Move settings load out of constructor

This commit is contained in:
Matt Borgerson
2020-04-25 16:24:33 -07:00
parent 8baa62da00
commit 6b97fbb3ef

View File

@ -943,6 +943,9 @@ static void ShowInputWindow(bool* p_open)
struct SettingsWindow struct SettingsWindow
{ {
bool dirty;
bool pending_restart;
char flash_path[MAX_STRING_LEN]; char flash_path[MAX_STRING_LEN];
char bootrom_path[MAX_STRING_LEN]; char bootrom_path[MAX_STRING_LEN];
char hdd_path[MAX_STRING_LEN]; char hdd_path[MAX_STRING_LEN];
@ -950,18 +953,18 @@ struct SettingsWindow
char eeprom_path[MAX_STRING_LEN]; char eeprom_path[MAX_STRING_LEN];
int memory_idx; int memory_idx;
bool short_animation; bool short_animation;
bool dirty;
bool pending_restart;
SettingsWindow() SettingsWindow()
{ {
Load(); // Note: This does not catch updates made elsewhere! That isn't flash_path[0] = '\0';
// a problem yet, but in the future might need to be changed to bootrom_path[0] = '\0';
// get most recent data. I put it here so we don't need to sync hdd_path[0] = '\0';
// settings back to these temporary buffers on every frame. dvd_path[0] = '\0';
// Please don't do this. If you need it, consider adding an "on eeprom_path[0] = '\0';
// settings updated" callback to sync the updates, if necessary. memory_idx = 0;
short_animation = false;
pending_restart = false; pending_restart = false;
dirty = false;
} }
~SettingsWindow() ~SettingsWindow()