From ba4b3396c017516d5376e0651b8a8844d30acfa7 Mon Sep 17 00:00:00 2001 From: 3lacksky <65866854+3lack5ky@users.noreply.github.com> Date: Tue, 11 Feb 2025 09:05:18 +0100 Subject: [PATCH 1/2] Update WindowManagement.cpp Added ability to scale the theme automatically to the display_size.y. If theme has number as scale nothing changes, if theme has string as scale e.g. "1.0" scale will automatically be changed and can be adjusted by changing the number. For Scale = "1.0": Y size = automatic scale setting. 1080 = 0.700 1200 = 0.769 1440 = 0.907 1600 = 1.000 2400 = 1.461 --- RocketStats/Managements/WindowManagement.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/RocketStats/Managements/WindowManagement.cpp b/RocketStats/Managements/WindowManagement.cpp index 94313bf6..8be413f4 100644 --- a/RocketStats/Managements/WindowManagement.cpp +++ b/RocketStats/Managements/WindowManagement.cpp @@ -219,8 +219,11 @@ void RocketStats::RenderOverlay() if (rs_recovery != RecoveryFlags_Finish && !GetCVar("rs_scale", rs_scale)) { rs_scale = 1.f; - if (theme_config["scale"].is_number()) + if (theme_config["scale"].is_string()) + rs_scale = std::stof(std::string(theme_config["scale"])) * (0.7 + (display_size.y - 1080) / 520 * 0.3); + else if (theme_config["scale"].is_number()) { rs_scale = float(theme_config["scale"]); + } } if (!GetCVar("rs_rotate", rs_rotate)) @@ -702,8 +705,11 @@ void RocketStats::RenderSettings() if (ImGui::Button("R##Rscale")) { rs_scale = 1.f; - if (theme_config["scale"].is_number()) - rs_scale = float(theme_config["scale"]); + if (theme_config["scale"].is_string()) + rs_scale = std::stof(std::string(theme_config["scale"])) * (0.7 + (display_size.y - 1080) / 520 * 0.3); + else if (theme_config["scale"].is_number()) { + rs_scale = float(theme_config["scale"]); + } } if (ImGui::IsItemHovered()) tooltip = GetLang(LANG_RESET_TOOLTIP); From 97d2b8b333d2dc741f28e71da89475ede19f24a9 Mon Sep 17 00:00:00 2001 From: 3lacksky <65866854+3lack5ky@users.noreply.github.com> Date: Tue, 11 Feb 2025 10:40:22 +0100 Subject: [PATCH 2/2] Update WindowManagement.cpp Adjusted Values. Example for scale "1.0": Y size = scale in menu 1600 = 1.110 1440 = 0.999 1200 = 0.833 1080 = 0.750 Example for Scale "0.9": Y size = scale in menu 1600 = 0.999 1440 = 0.899 1200 = 0.749 1080 = 0.675 --- RocketStats/Managements/WindowManagement.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RocketStats/Managements/WindowManagement.cpp b/RocketStats/Managements/WindowManagement.cpp index 8be413f4..ceda36da 100644 --- a/RocketStats/Managements/WindowManagement.cpp +++ b/RocketStats/Managements/WindowManagement.cpp @@ -220,7 +220,7 @@ void RocketStats::RenderOverlay() { rs_scale = 1.f; if (theme_config["scale"].is_string()) - rs_scale = std::stof(std::string(theme_config["scale"])) * (0.7 + (display_size.y - 1080) / 520 * 0.3); + rs_scale = std::stof(std::string(theme_config["scale"])) * (0.500 + (display_size.y - 720) / 880 * 0.61); else if (theme_config["scale"].is_number()) { rs_scale = float(theme_config["scale"]); } @@ -706,7 +706,7 @@ void RocketStats::RenderSettings() { rs_scale = 1.f; if (theme_config["scale"].is_string()) - rs_scale = std::stof(std::string(theme_config["scale"])) * (0.7 + (display_size.y - 1080) / 520 * 0.3); + rs_scale = std::stof(std::string(theme_config["scale"])) * (0.500 + (display_size.y - 720) / 880 * 0.61); else if (theme_config["scale"].is_number()) { rs_scale = float(theme_config["scale"]); }