From 4447e010d7516a0799c17e8e249bc4f5384a3daa Mon Sep 17 00:00:00 2001 From: Arisotura Date: Tue, 11 Jun 2019 18:57:22 +0200 Subject: actually save the current joystick ID --- src/libui_sdl/DlgInputConfig.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libui_sdl/DlgInputConfig.cpp b/src/libui_sdl/DlgInputConfig.cpp index c2059d1..d3ef2f4 100644 --- a/src/libui_sdl/DlgInputConfig.cpp +++ b/src/libui_sdl/DlgInputConfig.cpp @@ -318,6 +318,10 @@ int OnCloseWindow(uiWindow* window, void* blarg) InputDlgData* dlg = (InputDlgData*)(uiControl(window)->UserData); openedmask &= ~(1 << dlg->type); if (dlg->timer) SDL_RemoveTimer(dlg->timer); + + JoystickID = Config::JoystickID; + OpenJoystick(); + return 1; } @@ -340,6 +344,9 @@ void OnCancel(uiButton* btn, void* data) uiControlDestroy(uiControl(dlg->win)); openedmask &= ~(1 << dlg->type); if (dlg->timer) SDL_RemoveTimer(dlg->timer); + + JoystickID = Config::JoystickID; + OpenJoystick(); } void OnOk(uiButton* btn, void* data) @@ -357,6 +364,8 @@ void OnOk(uiButton* btn, void* data) memcpy(Config::HKJoyMapping, dlg->joymap, sizeof(int)*HK_MAX); } + Config::JoystickID = JoystickID; + Config::Save(); uiControlDestroy(uiControl(dlg->win)); -- cgit v1.2.3