fix options menu reset to default logic getting executed when setting is already default (#461)

This commit is contained in:
ĐeäTh 2025-02-24 17:17:47 +01:00 committed by GitHub
parent 388a86e866
commit 0b16633ee1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -859,16 +859,19 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef<T>* conf
if (g_canReset && padState.IsTapped(SWA::eKeyState_X)) if (g_canReset && padState.IsTapped(SWA::eKeyState_X))
{ {
config->MakeDefault(); if (!config->IsDefaultValue())
{
config->MakeDefault();
VideoConfigValueChangedCallback(config); VideoConfigValueChangedCallback(config);
XAudioConfigValueChangedCallback(config); XAudioConfigValueChangedCallback(config);
if (config->Callback) if (config->Callback)
config->Callback(config); config->Callback(config);
if (config->ApplyCallback) if (config->ApplyCallback)
config->ApplyCallback(config); config->ApplyCallback(config);
}
Game_PlaySound("sys_worldmap_decide"); Game_PlaySound("sys_worldmap_decide");
} }