diff options
author | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-01-22 21:40:28 +0100 |
---|---|---|
committer | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-01-23 14:18:19 +0100 |
commit | 1b3284042446551f6ff5a2c723957056131f5f31 (patch) | |
tree | 7ea98fd4aa5eb80ef24185f4ec3df373ee91f83d /src/skel/win/win.cpp | |
parent | Migrate from old .ini to new .ini (diff) | |
download | re3-1b3284042446551f6ff5a2c723957056131f5f31.tar re3-1b3284042446551f6ff5a2c723957056131f5f31.tar.gz re3-1b3284042446551f6ff5a2c723957056131f5f31.tar.bz2 re3-1b3284042446551f6ff5a2c723957056131f5f31.tar.lz re3-1b3284042446551f6ff5a2c723957056131f5f31.tar.xz re3-1b3284042446551f6ff5a2c723957056131f5f31.tar.zst re3-1b3284042446551f6ff5a2c723957056131f5f31.zip |
Diffstat (limited to '')
-rw-r--r-- | src/skel/win/win.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index 02b3f917..4963450a 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -2142,12 +2142,18 @@ WinMain(HINSTANCE instance, ShowWindow(PSGLOBAL(window), cmdShow); UpdateWindow(PSGLOBAL(window)); - // This part is needed because controller initialisation overwrites loaded settings. { 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("gta_vc.set", "r"); - + if ( gta3set ) { ControlsManager.LoadSettings(gta3set); @@ -2158,6 +2164,10 @@ WinMain(HINSTANCE instance, #ifdef LOAD_INI_SETTINGS LoadINIControllerSettings(); + if (connectedPadButtons != 0) { + ControlsManager.InitDefaultControlConfigJoyPad(connectedPadButtons); + SaveINIControllerSettings(); + } #endif } |