actually save the current joystick ID

This commit is contained in:
Arisotura 2019-06-11 18:57:22 +02:00
parent b9183b8818
commit 4447e010d7
1 changed files with 9 additions and 0 deletions

View File

@ -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));