diff --git a/include/opl.h b/include/opl.h index c31752ad4..6c31b0376 100644 --- a/include/opl.h +++ b/include/opl.h @@ -138,6 +138,9 @@ int gFadeDelay; int toggleSfx; int showCfgPopup; +int showThmPopup; +int showLngPopup; +int popupSfxPlayed; #ifdef IGS #define IGS_VERSION "0.1" diff --git a/src/gui.c b/src/gui.c index 9fb1c4ff4..a57739979 100644 --- a/src/gui.c +++ b/src/gui.c @@ -48,12 +48,8 @@ static ee_sema_t gQueueSema; static int screenWidth; static int screenHeight; -static int popupSfxPlayed; static int popupTimer; -static int showThmPopup; -static int showLngPopup; - // forward decl. static void guiShow(); @@ -241,12 +237,10 @@ void guiShowAbout() static void guiBootNotifications(void) { if (gEnableNotifications) { - int themeID = thmGetGuiValue(); - if (themeID != 0) + if (thmGetGuiValue() != 0) showThmPopup = 1; - int langID = lngGetGuiValue(); - if (langID != 0) + if (lngGetGuiValue() != 0) showLngPopup = 1; if (showThmPopup || showLngPopup || showCfgPopup) { @@ -599,8 +593,6 @@ void guiShowUIConfig(void) , "HDTV 1920x1080i @60Hz 16bit (HIRES)" , NULL}; int previousVMode; - int previousTheme = thmGetGuiValue(); - int previousLang = lngGetGuiValue(); reselect_video_mode: previousVMode = gVMode; @@ -650,16 +642,6 @@ void guiShowUIConfig(void) //wait 70ms for confirm sound to finish playing before clearing buffer guiDelay(0070); sfxInit(0); - - if (previousTheme != themeID && themeID != 0) { - showThmPopup = 1; - popupSfxPlayed = 0; - } - - if (previousLang != langID && langID != 0) { - showLngPopup = 1; - popupSfxPlayed = 0; - } } if (previousVMode != gVMode) { diff --git a/src/opl.c b/src/opl.c index 75271e1a9..a438bbff4 100644 --- a/src/opl.c +++ b/src/opl.c @@ -127,8 +127,13 @@ void moduleUpdateMenu(int mode, int themeChanged, int langChanged) if (!mod->support) return; - if (langChanged) + if (langChanged) { guiUpdateScreenScale(); + if (lngGetGuiValue() != 0) { + showLngPopup = 1; + popupSfxPlayed = 0; + } + } // refresh Hints menuRemoveHints(&mod->menuItem); @@ -153,8 +158,13 @@ void moduleUpdateMenu(int mode, int themeChanged, int langChanged) } // refresh Cache - if (themeChanged) + if (themeChanged) { submenuRebuildCache(mod->subMenu); + if (thmGetGuiValue() != 0) { + showThmPopup = 1; + popupSfxPlayed = 0; + } + } } static void itemExecSelect(struct menu_item *curMenu)