for config dialogs that reflect changes instantly, make behavior of window close button consistent with that of Cancel button

This commit is contained in:
Arisotura
2019-05-25 21:03:39 +02:00
parent eb6fe823f8
commit dd14a3e88e
2 changed files with 53 additions and 40 deletions

View File

@ -44,8 +44,15 @@ uiEntry* txMicWavPath;
int oldvolume;
void RevertSettings()
{
Config::AudioVolume = oldvolume;
}
int OnCloseWindow(uiWindow* window, void* blarg)
{
RevertSettings();
opened = false;
return 1;
}
@ -69,7 +76,7 @@ void OnMicWavBrowse(uiButton* btn, void* blarg)
void OnCancel(uiButton* btn, void* blarg)
{
Config::AudioVolume = oldvolume;
RevertSettings();
uiControlDestroy(uiControl(win));
opened = false;