From fcb40ac86de3a6eee840ff0ee55ad89a1a1a98ed Mon Sep 17 00:00:00 2001 From: otavepto <153766569+otavepto@users.noreply.github.com> Date: Thu, 20 Jun 2024 05:54:04 +0300 Subject: [PATCH] allow specifying durations for each notification type --- dll/dll/settings.h | 6 +++++- dll/settings_parser.cpp | 16 ++++++++++++++++ .../configs.overlay.EXAMPLE.ini | 14 ++++++++++++-- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/dll/dll/settings.h b/dll/dll/settings.h index 03342023..83296270 100644 --- a/dll/dll/settings.h +++ b/dll/dll/settings.h @@ -133,13 +133,17 @@ struct Overlay_Appearance { float notification_margin_y = 5.0f; // vertical margin uint32 notification_animation = 350; // sliding animation duration (millisec) + uint32 notification_duration_progress = 3500; // achievement progress indication duration (millisec) + uint32 notification_duration_achievement = 5000; // achievement unlocked duration (millisec) + uint32 notification_duration_invitation = 8000; // friend invitation duration (millisec) + uint32 notification_duration_chat = 4000; // sliding animation duration duration (millisec) std::string ach_unlock_datetime_format = "%Y/%m/%d - %H:%M:%S"; float background_r = 0.12f; float background_g = 0.11f; float background_b = 0.11f; - float background_a = 1.0f; + float background_a = 0.55f; float element_r = 0.30f; float element_g = 0.32f; diff --git a/dll/settings_parser.cpp b/dll/settings_parser.cpp index b5375e98..8740242e 100644 --- a/dll/settings_parser.cpp +++ b/dll/settings_parser.cpp @@ -281,6 +281,22 @@ static void load_overlay_appearance(class Settings *settings_client, class Setti uint32 nnotification_animation = (uint32)(std::stof(value, NULL) * 1000.0f); // convert sec to milli settings_client->overlay_appearance.notification_animation = nnotification_animation; settings_server->overlay_appearance.notification_animation = nnotification_animation; + } else if (name.compare("Notification_Duration_Progress") == 0) { + uint32 time = (uint32)(std::stof(value, NULL) * 1000.0f); // convert sec to milli + settings_client->overlay_appearance.notification_duration_progress = time; + settings_server->overlay_appearance.notification_duration_progress = time; + } else if (name.compare("Notification_Duration_Achievement") == 0) { + uint32 time = (uint32)(std::stof(value, NULL) * 1000.0f); // convert sec to milli + settings_client->overlay_appearance.notification_duration_achievement = time; + settings_server->overlay_appearance.notification_duration_achievement = time; + } else if (name.compare("Notification_Duration_Invitation") == 0) { + uint32 time = (uint32)(std::stof(value, NULL) * 1000.0f); // convert sec to milli + settings_client->overlay_appearance.notification_duration_invitation = time; + settings_server->overlay_appearance.notification_duration_invitation = time; + } else if (name.compare("Notification_Duration_Chat") == 0) { + uint32 time = (uint32)(std::stof(value, NULL) * 1000.0f); // convert sec to milli + settings_client->overlay_appearance.notification_duration_chat = time; + settings_server->overlay_appearance.notification_duration_chat = time; } else if (name.compare("Achievement_Unlock_Datetime_Format") == 0) { settings_client->overlay_appearance.ach_unlock_datetime_format = value; settings_server->overlay_appearance.ach_unlock_datetime_format = value; diff --git a/post_build/steam_settings.EXAMPLE/configs.overlay.EXAMPLE.ini b/post_build/steam_settings.EXAMPLE/configs.overlay.EXAMPLE.ini index 7c64c51f..2979dd65 100644 --- a/post_build/steam_settings.EXAMPLE/configs.overlay.EXAMPLE.ini +++ b/post_build/steam_settings.EXAMPLE/configs.overlay.EXAMPLE.ini @@ -60,18 +60,28 @@ Notification_Rounding=10.0 Notification_Margin_x=5.0 Notification_Margin_y=5.0 -# notification animation in seconds. Set to 0 to disable +# duration/timing for various notification types (in seconds) +# duration of notification animation in seconds. Set to 0 to disable Notification_Animation=0.35 +# duration of achievement progress indication +Notification_Duration_Progress=3.5 +# duration of achievement unlocked +Notification_Duration_Achievement=5.0 +# duration of friend invitation +Notification_Duration_Invitation=8.0 +# duration of chat message +Notification_Duration_Chat=4.0 # format for the achievement unlock date/time, limited to 79 characters # if the output formatted string exceeded this limit, the builtin format will be used # look for the format here: https://en.cppreference.com/w/cpp/chrono/c/strftime Achievement_Unlock_Datetime_Format=%Y/%m/%d - %H:%M:%S +# main background when you press shift+tab Background_R=0.12 Background_G=0.11 Background_B=0.11 -Background_A=1.0 +Background_A=0.55 Element_R=0.30 Element_G=0.32