No more resetting bindings for joypad, create .ini at the first start, joystick hotplug for Linux

This commit is contained in:
erorcun 2021-01-22 23:40:28 +03:00
parent 45c2488e36
commit 1b32840424
8 changed files with 133 additions and 87 deletions

View file

@ -3045,8 +3045,13 @@ CMenuManager::LoadSettings()
CFileMgr::SetDir("");
#ifdef LOAD_INI_SETTINGS
LoadINISettings();
LoadINIControllerSettings(); // Calling that after LoadINISettings is important because of gSelectedJoystickName loading
if (LoadINISettings()) {
LoadINIControllerSettings();
} else {
// no re3.ini, create it
SaveINISettings();
SaveINIControllerSettings();
}
#endif
#ifdef FIX_BUGS
@ -3160,12 +3165,6 @@ CMenuManager::SaveSettings()
#else
m_lastWorking3DAudioProvider = m_nPrefsAudio3DProviderIndex;
static bool firstTime = true;
// In other conditions we already call SaveINIControllerSettings explicitly.
if (firstTime) {
SaveINIControllerSettings();
firstTime = false;
}
SaveINISettings();
#endif
}
@ -5450,6 +5449,9 @@ CMenuManager::SwitchMenuOnAndOff()
ThingsToDoBeforeLeavingPage();
#endif
SaveSettings();
#ifdef LOAD_INI_SETTINGS
SaveINIControllerSettings();
#endif
pControlEdit = nil;
pEditString = nil;
DisplayComboButtonErrMsg = false;