mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 13:20:57 -06:00
for config dialogs that reflect changes instantly, make behavior of window close button consistent with that of Cancel button
This commit is contained in:
@ -44,8 +44,15 @@ uiEntry* txMicWavPath;
|
|||||||
int oldvolume;
|
int oldvolume;
|
||||||
|
|
||||||
|
|
||||||
|
void RevertSettings()
|
||||||
|
{
|
||||||
|
Config::AudioVolume = oldvolume;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int OnCloseWindow(uiWindow* window, void* blarg)
|
int OnCloseWindow(uiWindow* window, void* blarg)
|
||||||
{
|
{
|
||||||
|
RevertSettings();
|
||||||
opened = false;
|
opened = false;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -69,7 +76,7 @@ void OnMicWavBrowse(uiButton* btn, void* blarg)
|
|||||||
|
|
||||||
void OnCancel(uiButton* btn, void* blarg)
|
void OnCancel(uiButton* btn, void* blarg)
|
||||||
{
|
{
|
||||||
Config::AudioVolume = oldvolume;
|
RevertSettings();
|
||||||
|
|
||||||
uiControlDestroy(uiControl(win));
|
uiControlDestroy(uiControl(win));
|
||||||
opened = false;
|
opened = false;
|
||||||
|
@ -70,9 +70,53 @@ void UpdateControls()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RevertSettings()
|
||||||
|
{
|
||||||
|
bool apply0 = false;
|
||||||
|
bool apply2 = false;
|
||||||
|
bool apply3 = false;
|
||||||
|
|
||||||
|
bool old_usegl = (old_gldisplay != 0) || (old_renderer != 0);
|
||||||
|
bool new_usegl = (Config::ScreenUseGL != 0) || (Config::_3DRenderer != 0);
|
||||||
|
|
||||||
|
if (old_renderer != Config::_3DRenderer)
|
||||||
|
{
|
||||||
|
Config::_3DRenderer = old_renderer;
|
||||||
|
apply3 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (old_gldisplay != Config::ScreenUseGL)
|
||||||
|
{
|
||||||
|
Config::ScreenUseGL = old_gldisplay;
|
||||||
|
}
|
||||||
|
if (old_usegl != new_usegl)
|
||||||
|
{
|
||||||
|
apply2 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (old_threaded3D != Config::Threaded3D)
|
||||||
|
{
|
||||||
|
Config::Threaded3D = old_threaded3D;
|
||||||
|
apply0 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (old_resolution != Config::GL_ScaleFactor ||
|
||||||
|
old_antialias != Config::GL_Antialias)
|
||||||
|
{
|
||||||
|
Config::GL_ScaleFactor = old_resolution;
|
||||||
|
Config::GL_Antialias = old_antialias;
|
||||||
|
apply0 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (apply2) ApplyNewSettings(2);
|
||||||
|
else if (apply3) ApplyNewSettings(3);
|
||||||
|
if (apply0) ApplyNewSettings(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int OnCloseWindow(uiWindow* window, void* blarg)
|
int OnCloseWindow(uiWindow* window, void* blarg)
|
||||||
{
|
{
|
||||||
|
RevertSettings();
|
||||||
opened = false;
|
opened = false;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -121,45 +165,7 @@ void OnAntialiasChanged(uiCheckbox* cb, void* blarg)
|
|||||||
|
|
||||||
void OnCancel(uiButton* btn, void* blarg)
|
void OnCancel(uiButton* btn, void* blarg)
|
||||||
{
|
{
|
||||||
bool apply0 = false;
|
RevertSettings();
|
||||||
bool apply2 = false;
|
|
||||||
bool apply3 = false;
|
|
||||||
|
|
||||||
bool old_usegl = (old_gldisplay != 0) || (old_renderer != 0);
|
|
||||||
bool new_usegl = (Config::ScreenUseGL != 0) || (Config::_3DRenderer != 0);
|
|
||||||
|
|
||||||
if (old_renderer != Config::_3DRenderer)
|
|
||||||
{
|
|
||||||
Config::_3DRenderer = old_renderer;
|
|
||||||
apply3 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (old_gldisplay != Config::ScreenUseGL)
|
|
||||||
{
|
|
||||||
Config::ScreenUseGL = old_gldisplay;
|
|
||||||
}
|
|
||||||
if (old_usegl != new_usegl)
|
|
||||||
{
|
|
||||||
apply2 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (old_threaded3D != Config::Threaded3D)
|
|
||||||
{
|
|
||||||
Config::Threaded3D = old_threaded3D;
|
|
||||||
apply0 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (old_resolution != Config::GL_ScaleFactor ||
|
|
||||||
old_antialias != Config::GL_Antialias)
|
|
||||||
{
|
|
||||||
Config::GL_ScaleFactor = old_resolution;
|
|
||||||
Config::GL_Antialias = old_antialias;
|
|
||||||
apply0 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (apply2) ApplyNewSettings(2);
|
|
||||||
else if (apply3) ApplyNewSettings(3);
|
|
||||||
if (apply0) ApplyNewSettings(0);
|
|
||||||
|
|
||||||
uiControlDestroy(uiControl(win));
|
uiControlDestroy(uiControl(win));
|
||||||
opened = false;
|
opened = false;
|
||||||
|
Reference in New Issue
Block a user