diff --git a/include/lang.h b/include/lang.h index 9f490fbbf..a4b9b7b15 100644 --- a/include/lang.h +++ b/include/lang.h @@ -259,7 +259,9 @@ enum _STR_IDS { _STR_CFM_VMODE_CHG, _STR_CACHE_HDD_GAME_LIST, _STR_ENABLE_NOTIFICATIONS, - _STR_NOTIFICATIONS, + _STR_CFG_NOTIFICATION, + _STR_THM_NOTIFICATION, + _STR_LNG_NOTIFICATION, _STR_OPTIONS, _STR_GAME_SETTINGS_SAVED, _STR_GAME_SETTINGS_REMOVED, diff --git a/lng/lang_English.lng b/lng/lang_English.lng index e0d904d62..a107f406f 100644 --- a/lng/lang_English.lng +++ b/lng/lang_English.lng @@ -276,7 +276,9 @@ Boot Sound Volume Confirm video mode change? Cache Game List (HDD) Notifications -%s loaded from %s +Config loaded from %s +Theme loaded from %s +Language loaded from %s Options Game settings saved. %s settings removed. diff --git a/src/gui.c b/src/gui.c index 385462d58..478177ae1 100644 --- a/src/gui.c +++ b/src/gui.c @@ -249,29 +249,23 @@ static void guiResetNotifications(void) popupTimer = 0; } -static void guiRenderNotifications(char *type, char *path, int y) +static void guiRenderNotifications(char *string, int y) { - char notification[128]; - char *col_pos; int x; - snprintf(notification, sizeof(notification), _l(_STR_NOTIFICATIONS), type, path); - if ((col_pos = strchr(notification, ':')) != NULL) - *(col_pos + 1) = '\0'; - - x = screenWidth - rmUnScaleX(fntCalcDimensions(gTheme->fonts[0], notification)) - 10; + x = screenWidth - rmUnScaleX(fntCalcDimensions(gTheme->fonts[0], string)) - 10; rmDrawRect(x - 10, y, screenWidth - x, MENU_ITEM_HEIGHT + 10, gColDarker); - fntRenderString(gTheme->fonts[0], x - 5, y + 5, ALIGN_NONE, 0, 0, notification, gTheme->textColor); + fntRenderString(gTheme->fonts[0], x - 5, y + 5, ALIGN_NONE, 0, 0, string, gTheme->textColor); } static void guiShowNotifications(void) { + char notification[128]; + char *col_pos; int y = 10; int yadd = 35; - clock_t currentTime; - currentTime = clock(); if (showThmPopup || showLngPopup || showCfgPopup) { if (!popupTimer) { popupTimer = clock() + 5000 * (CLOCKS_PER_SEC / 1000); @@ -279,19 +273,32 @@ static void guiShowNotifications(void) } if (showCfgPopup) { - guiRenderNotifications("CFG", configGetDir(), y); + snprintf(notification, sizeof(notification), _l(_STR_CFG_NOTIFICATION), configGetDir()); + if ((col_pos = strchr(notification, ':')) != NULL) + *(col_pos + 1) = '\0'; + + guiRenderNotifications(notification, y); y += yadd; } if (showThmPopup) { - guiRenderNotifications("THM", thmGetFilePath(thmGetGuiValue()), y); + snprintf(notification, sizeof(notification), _l(_STR_THM_NOTIFICATION), thmGetFilePath(thmGetGuiValue())); + if ((col_pos = strchr(notification, ':')) != NULL) + *(col_pos + 1) = '\0'; + + guiRenderNotifications(notification, y); y += yadd; } - if (showLngPopup) - guiRenderNotifications("LNG", lngGetFilePath(lngGetGuiValue()), y); + if (showLngPopup) { + snprintf(notification, sizeof(notification), _l(_STR_LNG_NOTIFICATION), lngGetFilePath(lngGetGuiValue())); + if ((col_pos = strchr(notification, ':')) != NULL) + *(col_pos + 1) = '\0'; + + guiRenderNotifications(notification, y); + } - if (currentTime >= popupTimer) { + if (clock() >= popupTimer) { guiResetNotifications(); showCfgPopup = 0; } diff --git a/src/lang.c b/src/lang.c index 695e73824..4eb6387f0 100644 --- a/src/lang.c +++ b/src/lang.c @@ -263,7 +263,9 @@ static char *internalEnglish[LANG_STR_COUNT] = { "Confirm video mode change?", "Cache Game List (HDD)", "Notifications", - "%s loaded from %s", + "Config loaded from %s", + "Theme loaded from %s", + "Language loaded from %s", "Options", "Game settings saved.", "%s settings removed.",