From 06dd4f38325f739f42fec47ddc10138e05a053a5 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 5 Jan 2025 20:50:58 +0100 Subject: [PATCH] Show notification with the current screen and audio if they are not "normal" and notifications are enabled --- src/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 241c8d7..278afbe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -332,6 +332,16 @@ INITIALIZE_PLUGIN() { DEBUG_FUNCTION_LINE_ERR("Failed to init config api"); } + if (gEnabled && gShowNotifications && gNotificationModuleInitDone) { + NotificationModule_SetDefaultValue(NOTIFICATION_MODULE_NOTIFICATION_TYPE_INFO, NOTIFICATION_MODULE_DEFAULT_OPTION_DURATION_BEFORE_FADE_OUT, 5.0f); + if (gCurScreenMode != SCREEN_MODE_NONE) { + NotificationModule_AddInfoNotification(screenModeToStr(gCurScreenMode)); + } + if (gCurAudioMode != AUDIO_MODE_NONE) { + NotificationModule_AddInfoNotification(audioModeToStr(gCurAudioMode)); + } + } + NotificationModule_SetDefaultValue(NOTIFICATION_MODULE_NOTIFICATION_TYPE_INFO, NOTIFICATION_MODULE_DEFAULT_OPTION_DURATION_BEFORE_FADE_OUT, 2.0f); NotificationModule_SetDefaultValue(NOTIFICATION_MODULE_NOTIFICATION_TYPE_INFO, NOTIFICATION_MODULE_DEFAULT_OPTION_KEEP_UNTIL_SHOWN, false); NotificationModule_SetDefaultValue(NOTIFICATION_MODULE_NOTIFICATION_TYPE_ERROR, NOTIFICATION_MODULE_DEFAULT_OPTION_DURATION_BEFORE_FADE_OUT, 2.0f);