diff --git a/src/libui_sdl/DlgInputConfig.cpp b/src/libui_sdl/DlgInputConfig.cpp index c2059d1e..d3ef2f4d 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));