wiiu: fix settings saving

This commit is contained in:
GaryOderNichts 2021-01-29 22:07:54 +01:00
parent 99fba1c037
commit 6a9d771041

View File

@ -288,7 +288,7 @@ psInitialize(void)
#ifndef PS2_MENU #ifndef PS2_MENU
#if GTA_VERSION < GTA3_PC_11 #if GTA_VERSION >= GTA3_PC_11
FrontEndMenuManager.LoadSettings(); FrontEndMenuManager.LoadSettings();
#endif #endif
@ -931,6 +931,13 @@ main(int argc, char *argv[])
{ {
CFileMgr::SetDirMyDocuments(); CFileMgr::SetDirMyDocuments();
#ifdef LOAD_INI_SETTINGS
// At this point InitDefaultControlConfigJoyPad must have set all bindings to default and ms_padButtonsInited to number of detected buttons.
// We will load stored bindings below, but let's cache ms_padButtonsInited before LoadINIControllerSettings and LoadSettings clears it,
// so we can add new joy bindings **on top of** stored bindings.
int connectedPadButtons = ControlsManager.ms_padButtonsInited;
#endif
int32 gta3set = CFileMgr::OpenFile("gta3.set", "r"); int32 gta3set = CFileMgr::OpenFile("gta3.set", "r");
if ( gta3set ) if ( gta3set )
@ -940,6 +947,14 @@ main(int argc, char *argv[])
} }
CFileMgr::SetDir(""); CFileMgr::SetDir("");
#ifdef LOAD_INI_SETTINGS
LoadINIControllerSettings();
if (connectedPadButtons != 0) {
ControlsManager.InitDefaultControlConfigJoyPad(connectedPadButtons);
SaveINIControllerSettings();
}
#endif
} }