* allow loading the overlay fonts from the global settings folder Goldberg SteamEmu Settings/settings/fonts

This commit is contained in:
otavepto 2024-04-11 01:16:53 +02:00
parent 71b831bd05
commit 9be27ffd85
6 changed files with 48 additions and 12 deletions

View File

@ -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
---

View File

@ -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();

View File

@ -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);

View File

@ -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`

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -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