Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion dll/dll/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,13 @@ struct Overlay_Appearance {
constexpr const static NotificationPosition default_pos = NotificationPosition::top_right;

std::string font_override{}; // path to a custom user-provided TTF font
std::string font_override_ach_title{}; // path to custom font for achievement title
std::string font_override_ach_desc{}; // path to custom font for achievement description
float font_size = 16.0f;
float font_size_fps = 0.0f;
float font_size_ach_title = 0.0f;
float font_size_ach_desc = 0.0f;
bool font_ach_title_bold = false;

float icon_size = 64.0f;

Expand Down Expand Up @@ -280,7 +286,7 @@ class Settings {
// allow stats not defined by the user?
bool allow_unknown_stats = false;

// whether to enable the functionality which reports an achievement progress for stats that are tied to achievements
//whether to enable the functionality which reports an achievement progress for stats that are tied to achievements
// only used internally for a stat that's tied to an achievement, the normal achievement progress requests made by the game are not impacted
bool stat_achievement_progress_functionality = true;
// when a stat that's tied to an achievement gets a new value, should the emu save that progress only if it's higher?
Expand Down
54 changes: 54 additions & 0 deletions dll/settings_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,64 @@ static void load_overlay_appearance(class Settings *settings_client, class Setti
} else {
PRINT_DEBUG(" ERROR font file '%s' doesn't exist and will be ignored", value.c_str());
}
} else if (name.compare("Font_Override_Achievement_Title") == 0) {
value = common_helpers::string_strip(value);
std::string nfont_override(common_helpers::to_absolute(value, Local_Storage::get_game_settings_path() + "fonts"));
if (!common_helpers::file_exist(nfont_override)) {
nfont_override.clear();
}
if (nfont_override.empty()) {
nfont_override = common_helpers::to_absolute(value, local_storage->get_global_settings_path() + "fonts");
if (!common_helpers::file_exist(nfont_override)) {
nfont_override.clear();
}
}
if (nfont_override.size()) {
settings_client->overlay_appearance.font_override_ach_title = nfont_override;
settings_server->overlay_appearance.font_override_ach_title = nfont_override;
PRINT_DEBUG(" loaded font '%s'", nfont_override.c_str());
} else {
PRINT_DEBUG(" ERROR font file '%s' doesn't exist and will be ignored", value.c_str());
}
} else if (name.compare("Font_Override_Achievement_Description") == 0) {
value = common_helpers::string_strip(value);
std::string nfont_override(common_helpers::to_absolute(value, Local_Storage::get_game_settings_path() + "fonts"));
if (!common_helpers::file_exist(nfont_override)) {
nfont_override.clear();
}
if (nfont_override.empty()) {
nfont_override = common_helpers::to_absolute(value, local_storage->get_global_settings_path() + "fonts");
if (!common_helpers::file_exist(nfont_override)) {
nfont_override.clear();
}
}
if (nfont_override.size()) {
settings_client->overlay_appearance.font_override_ach_desc = nfont_override;
settings_server->overlay_appearance.font_override_ach_desc = nfont_override;
PRINT_DEBUG(" loaded font '%s'", nfont_override.c_str());
} else {
PRINT_DEBUG(" ERROR font file '%s' doesn't exist and will be ignored", value.c_str());
}
} else if (name.compare("Font_Size") == 0) {
float nfont_size = std::stof(value, NULL);
settings_client->overlay_appearance.font_size = nfont_size;
settings_server->overlay_appearance.font_size = nfont_size;
} else if (name.compare("Font_Size_FPS") == 0) {
float nfont_size = std::stof(value, NULL);
settings_client->overlay_appearance.font_size_fps = nfont_size;
settings_server->overlay_appearance.font_size_fps = nfont_size;
} else if (name.compare("Font_Size_Achievement_Title") == 0) {
float nfont_size = std::stof(value, NULL);
settings_client->overlay_appearance.font_size_ach_title = nfont_size;
settings_server->overlay_appearance.font_size_ach_title = nfont_size;
} else if (name.compare("Font_Size_Achievement_Description") == 0) {
float nfont_size = std::stof(value, NULL);
settings_client->overlay_appearance.font_size_ach_desc = nfont_size;
settings_server->overlay_appearance.font_size_ach_desc = nfont_size;
} else if (name.compare("Font_Achievement_Title_Bold") == 0) {
bool bold = (std::stol(value, NULL) != 0);
settings_client->overlay_appearance.font_ach_title_bold = bold;
settings_server->overlay_appearance.font_ach_title_bold = bold;
} else if (name.compare("Icon_Size") == 0) {
float nicon_size = std::stof(value, NULL);
settings_client->overlay_appearance.icon_size = nicon_size;
Expand Down
5 changes: 4 additions & 1 deletion overlay_experimental/overlay/steam_overlay.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,13 @@ class Steam_Overlay

std::vector<InGameOverlay::ToggleKey> toggle_keys{};

// font stuff
// font stuff - now supporting independent font sizes
ImFontAtlas fonts_atlas{};
ImFont *font_default{};
ImFont *font_notif{};
ImFont *font_fps{}; // separate font for FPS display
ImFont *font_ach_title{}; // separate font for achievement title
ImFont *font_ach_desc{}; // separate font for achievement description
ImFontConfig font_cfg{};
ImFontGlyphRangesBuilder font_builder{};
ImVector<ImWchar> ranges{};
Expand Down
Loading