From 9be27ffd85d92f9809312ec73629880b998b8a60 Mon Sep 17 00:00:00 2001 From: otavepto Date: Thu, 11 Apr 2024 01:16:53 +0200 Subject: [PATCH] * allow loading the overlay fonts from the global settings folder `Goldberg SteamEmu Settings/settings/fonts` --- CHANGELOG.md | 8 +++++- dll/dll/common_includes.h | 2 +- dll/settings_parser.cpp | 22 ++++++++++++++--- post_build/README.release.md | 23 +++++++++++++++--- .../account_avatar_default.EXAMPLE.jpg | Bin 3409 -> 0 bytes .../overlay_appearance.EXAMPLE.txt | 5 ++-- 6 files changed, 48 insertions(+), 12 deletions(-) delete mode 100644 post_build/steam_settings.EXAMPLE/account_avatar_default.EXAMPLE.jpg 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 aa490cb4ea49d648b7d333c98c8f2acd01695589..0000000000000000000000000000000000000000 GIT binary patch literal 0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