diff options
author | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-01-15 10:36:58 +0100 |
---|---|---|
committer | shfil <filip.gawin@zoho.com> | 2021-01-17 21:33:53 +0100 |
commit | deaaf3d22f69cef5298ba5f18e5a96903d20f15a (patch) | |
tree | b7cc70be5ac6b83ea68830a65e180883011c0c79 /src/core | |
parent | Store all settings in .INI (diff) | |
download | re3-deaaf3d22f69cef5298ba5f18e5a96903d20f15a.tar re3-deaaf3d22f69cef5298ba5f18e5a96903d20f15a.tar.gz re3-deaaf3d22f69cef5298ba5f18e5a96903d20f15a.tar.bz2 re3-deaaf3d22f69cef5298ba5f18e5a96903d20f15a.tar.lz re3-deaaf3d22f69cef5298ba5f18e5a96903d20f15a.tar.xz re3-deaaf3d22f69cef5298ba5f18e5a96903d20f15a.tar.zst re3-deaaf3d22f69cef5298ba5f18e5a96903d20f15a.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/re3.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/re3.cpp b/src/core/re3.cpp index d7bf88ea..09eafe74 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -429,6 +429,7 @@ void LoadINISettings() #endif #ifdef CUSTOM_FRONTEND_OPTIONS + bool migrate = cfg.category_size("FrontendOptions") != 0; for (int i = 0; i < MENUPAGES; i++) { for (int j = 0; j < NUM_MENUROWS; j++) { CMenuScreenCustom::CMenuEntry &option = aScreens[i].m_aEntries[j]; @@ -438,7 +439,13 @@ void LoadINISettings() // CFO check if (option.m_Action < MENUACTION_NOTHING && option.m_CFO->save) { // CFO only supports saving uint8 right now - ReadIniIfExists(option.m_CFO->saveCat, option.m_CFO->save, option.m_CFO->value); + + // Migrate from old .ini to new .ini + if (migrate && ReadIniIfExists("FrontendOptions", option.m_CFO->save, option.m_CFO->value)) + cfg.remove("FrontendOptions", option.m_CFO->save); + else + ReadIniIfExists(option.m_CFO->saveCat, option.m_CFO->save, option.m_CFO->value); + if (option.m_Action == MENUACTION_CFO_SELECT) { option.m_CFOSelect->lastSavedValue = option.m_CFOSelect->displayedValue = *option.m_CFO->value; } |