diff --git a/overlay_experimental/overlay/steam_overlay.h b/overlay_experimental/overlay/steam_overlay.h index 39dcc52b..c1fe5409 100644 --- a/overlay_experimental/overlay/steam_overlay.h +++ b/overlay_experimental/overlay/steam_overlay.h @@ -102,6 +102,7 @@ struct NotificationsIndexes class Steam_Overlay { + constexpr static const char ACH_SOUNDS_FOLDER[] = "sounds"; constexpr static const char ACH_FALLBACK_DIR[] = "achievement_images"; class Settings* settings; diff --git a/overlay_experimental/steam_overlay.cpp b/overlay_experimental/steam_overlay.cpp index 223f3dd2..8d300383 100644 --- a/overlay_experimental/steam_overlay.cpp +++ b/overlay_experimental/steam_overlay.cpp @@ -325,7 +325,7 @@ void Steam_Overlay::load_audio() // try local location first, then try global location for (const auto &settings_path : { Local_Storage::get_game_settings_path(), local_storage->get_global_settings_path() }) { - file_path = settings_path + kv.first; + file_path = settings_path + Steam_Overlay::ACH_SOUNDS_FOLDER + PATH_SEPARATOR + kv.first; file_size = file_size_(file_path); if (file_size) break; } @@ -335,6 +335,7 @@ void Steam_Overlay::load_audio() kv.second.assign(file_size + 1, 0); // +1 because this will be treated as a null-terminated string later int read = Local_Storage::get_file_data(file_path, (char *)&kv.second[0], file_size); if (read <= 0) kv.second.clear(); + PRINT_DEBUG("loaded '%s' (read %i/%u bytes)", file_path.c_str(), read, file_size); } } } @@ -1096,7 +1097,7 @@ bool Steam_Overlay::try_load_ach_icon(Overlay_Achievement &ach, bool achieved) std::string file_path(Local_Storage::get_game_settings_path() + icon_name); unsigned int file_size = file_size_(file_path); if (!file_size) { - file_path = Local_Storage::get_game_settings_path() + Steam_Overlay::ACH_FALLBACK_DIR + "/" + icon_name; + file_path = Local_Storage::get_game_settings_path() + Steam_Overlay::ACH_FALLBACK_DIR + PATH_SEPARATOR + icon_name; file_size = file_size_(file_path); } if (file_size) { diff --git a/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/LICENSE.md b/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/LICENSE.md new file mode 100644 index 00000000..91b7e575 --- /dev/null +++ b/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/LICENSE.md @@ -0,0 +1,5 @@ +Both files `overlay_achievement_notification.wav` and `overlay_friend_notification.wav` are called `"A Tone"` +* Source: https://soundbible.com/1815-A-Tone.html +* License: Public Domain + https://creativecommons.org/public-domain/ + https://wiki.creativecommons.org/wiki/public_domain \ No newline at end of file diff --git a/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/README.md b/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/README.md new file mode 100644 index 00000000..f0c6f604 --- /dev/null +++ b/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/README.md @@ -0,0 +1,5 @@ +**This is currently available for Windows only** + +Place your overlay audio files here. +* `overlay_achievement_notification.wav`: will be played when an achievement is unlocked +* `overlay_friend_notification.wav`: will be played when a friend sends an invitation \ No newline at end of file diff --git a/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/overlay_achievement_notification.wav b/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/overlay_achievement_notification.wav new file mode 100644 index 00000000..7fbc54cb Binary files /dev/null and b/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/overlay_achievement_notification.wav differ diff --git a/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/overlay_friend_notification.wav b/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/overlay_friend_notification.wav new file mode 100644 index 00000000..7fbc54cb Binary files /dev/null and b/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/overlay_friend_notification.wav differ