diff --git a/CHANGELOG.md b/CHANGELOG.md index fcd5dcc1..4ea820bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -* **[breaking]** load overlay audio from `sounds` subfolder +## 2024/4/11 + +* **[breaking]** load overlay audio from `sounds` subfolder, either from the local game settings folder `steam_settings/sounds`, + or from the global settings folder `Goldberg SteamEmu Settings/settings/sounds` +* allow loading the overlay fonts from the global settings folder `Goldberg SteamEmu Settings/settings/fonts` +* added missing example overlay `.wav` file +* updated readme files + added some which were missing + removed invalid avatar example --- diff --git a/dll/dll/common_includes.h b/dll/dll/common_includes.h index e6f6360b..5c72b887 100644 --- a/dll/dll/common_includes.h +++ b/dll/dll/common_includes.h @@ -112,7 +112,7 @@ static inline std::string utf8_encode(const std::wstring &wstr) return strTo; } -// Convert an UTF8 string to a wide Unicode String +// Convert UTF8 string to a wide Unicode String static inline std::wstring utf8_decode(const std::string &str) { if( str.empty() ) return std::wstring(); diff --git a/dll/settings_parser.cpp b/dll/settings_parser.cpp index 0dd3067f..ad11db19 100644 --- a/dll/settings_parser.cpp +++ b/dll/settings_parser.cpp @@ -71,7 +71,7 @@ static void load_subscribed_groups_clans(std::string clans_filepath, Settings *s } } -static void load_overlay_appearance(std::string appearance_filepath, Settings *settings_client, Settings *settings_server) +static void load_overlay_appearance(std::string appearance_filepath, class Settings *settings_client, class Settings *settings_server, class Local_Storage *local_storage) { std::ifstream appearance_file(utf8_decode(appearance_filepath)); if (appearance_file.is_open()) { @@ -102,12 +102,26 @@ static void load_overlay_appearance(std::string appearance_filepath, Settings *s PRINT_DEBUG(" Overlay appearance line '%s'='%s'", name.c_str(), value.c_str()); try { if (name.compare("Font_Override") == 0) { + // first try the local settings folder std::string nfont_override(common_helpers::to_absolute(value, Local_Storage::get_game_settings_path() + "fonts")); if (common_helpers::file_exist(nfont_override)) { settings_client->overlay_appearance.font_override = nfont_override; settings_server->overlay_appearance.font_override = nfont_override; + } + + // then try the global settings folder + if (settings_client->overlay_appearance.font_override.empty()) { + nfont_override = common_helpers::to_absolute(value, local_storage->get_global_settings_path() + "fonts"); + if (common_helpers::file_exist(nfont_override)) { + settings_client->overlay_appearance.font_override = nfont_override; + settings_server->overlay_appearance.font_override = nfont_override; + } + } + + if (settings_client->overlay_appearance.font_override.empty()) { + PRINT_DEBUG(" ERROR font file '%s' doesn't exist and will be ignored", value.c_str()); } else { - PRINT_DEBUG(" ERROR font file '%s' doesn't exist and will be ignored", nfont_override.c_str()); + PRINT_DEBUG(" loaded font '%s'", nfont_override.c_str()); } } else if (name.compare("Font_Size") == 0) { float nfont_size = std::stof(value, NULL); @@ -1388,8 +1402,8 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s load_subscribed_groups_clans(local_storage->get_global_settings_path() + "subscribed_groups_clans.txt", settings_client, settings_server); load_subscribed_groups_clans(Local_Storage::get_game_settings_path() + "subscribed_groups_clans.txt", settings_client, settings_server); - load_overlay_appearance(local_storage->get_global_settings_path() + "overlay_appearance.txt", settings_client, settings_server); - load_overlay_appearance(Local_Storage::get_game_settings_path() + "overlay_appearance.txt", settings_client, settings_server); + load_overlay_appearance(local_storage->get_global_settings_path() + "overlay_appearance.txt", settings_client, settings_server, local_storage); + load_overlay_appearance(Local_Storage::get_game_settings_path() + "overlay_appearance.txt", settings_client, settings_server, local_storage); parse_mods_folder(settings_client, settings_server, local_storage); load_gamecontroller_settings(settings_client); diff --git a/post_build/README.release.md b/post_build/README.release.md index 06eef18e..93231e89 100644 --- a/post_build/README.release.md +++ b/post_build/README.release.md @@ -244,11 +244,10 @@ To allow external downloads which will be stored in this `steam_settings\http` f --- ## Avatar: -Copy a `PNG` or `JPG` image to your `Goldberg SteamEmu Settings\settings` folder and name it `account_avatar` +Copy a `png`, or a `jpg`, or a `jpeg` image file to your `Goldberg SteamEmu Settings\settings` folder and name it `account_avatar`. +You can also place this file inside the local `steam_settings` folder of the game. -You can also set a default profile picture for users who are missing one by copying a similar file called `account_avatar_default` - -You can find example in `steam_settings.EXAMPLE` +You can find an example in `steam_settings.EXAMPLE` --- @@ -276,6 +275,20 @@ Use `SHIFT-TAB` to open the overlay. --- +## Overlay notifications sounds: +**Note: at the moment this feature is only enabled in the experimental builds for Windows only** +--- + +You can place a `.wav` file called `overlay_achievement_notification.wav` inside either the local `steam_settings/sounds` folder of the game, +or inside `Goldberg SteamEmu Settings/settings/sounds` folder, to play that audio file whenever an achievement is unlocked. + +You can place a `.wav` file called `overlay_friend_notification.wav` inside either the local `steam_settings/sounds` folder of the game, +or inside `Goldberg SteamEmu Settings/settings/sounds` folder, to play that audio file whenever a friend sends an achievement. + +You can find an example in `steam_settings.EXAMPLE` + +--- + ## Controller: **Note: at the moment this feature is only enabled in the windows experimental builds and the linux builds** --- @@ -447,6 +460,8 @@ Check the example files in the `steam_settings` folder --- These configuration file `overlay_appearance.txt` has various options to set for the overlay appearance. +You can place this file inside the local `steam_settings/` folder, or inside the global settings folder `Goldberg SteamEmu Settings/settings/`. + The notifications positions could be set to one of these values: * `top_left` * `top_center` diff --git a/post_build/steam_settings.EXAMPLE/account_avatar_default.EXAMPLE.jpg b/post_build/steam_settings.EXAMPLE/account_avatar_default.EXAMPLE.jpg deleted file mode 100644 index aa490cb4..00000000 Binary files a/post_build/steam_settings.EXAMPLE/account_avatar_default.EXAMPLE.jpg and /dev/null differ diff --git a/post_build/steam_settings.EXAMPLE/overlay_appearance.EXAMPLE.txt b/post_build/steam_settings.EXAMPLE/overlay_appearance.EXAMPLE.txt index 9140f5ae..463c6031 100644 --- a/post_build/steam_settings.EXAMPLE/overlay_appearance.EXAMPLE.txt +++ b/post_build/steam_settings.EXAMPLE/overlay_appearance.EXAMPLE.txt @@ -3,8 +3,9 @@ ; only set the parameters relevant to your use case ; --------------------------- -; load custom TrueType font from a path -; path could be absolute, or relative to steam_settings/fonts +; load custom TrueType font from a path, it could be absolute, or relative +; relative paths will be looked up inside the local folder "steam_settings/fonts" first, +; if that wasn't found, it will be looked up inside the global folder "Goldberg SteamEmu Settings/settings/fonts" Font_Override BungeeSpice-Regular.ttf ; global font size