From bd9011276e8a890d5f5d8e2dcc77f662a194085d Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Mon, 12 Sep 2022 02:57:37 +0300 Subject: [PATCH] fix font scaling for QHD and 4K res --- YAS/Classes/GUIStyleBase.uc | 11 ++++++++--- YAS/Classes/YAS_Types.uc | 3 --- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/YAS/Classes/GUIStyleBase.uc b/YAS/Classes/GUIStyleBase.uc index 12847bc..82e3b7c 100644 --- a/YAS/Classes/GUIStyleBase.uc +++ b/YAS/Classes/GUIStyleBase.uc @@ -187,13 +187,18 @@ final function float ScreenScale(float Size, optional float MaxRes=1080.f) return Size * (FillSizeY / MaxRes); } -final function float GetFontScaler(optional float Scaler=0.750f, optional float Min=0.175f, optional float Max=1.0f) +final function float GetFontScaler() { - local float FillSizeX, FillSizeY; + local float FillSizeX, FillSizeY, Scaler; GetFillScreenSize(FillSizeX, FillSizeY); - return FClamp((FillSizeY / 1080.f) * Scaler, Min, Max); + if (FillSizeY <= 1080.0f) { scaler = 0.750f; } + else if (FillSizeY <= 1440.0f) { scaler = 0.562f; } + else if (FillSizeY <= 2160.0f) { scaler = 0.377f; } + else { scaler = 0.190f; } + + return FClamp(FillSizeY * scaler / 1080.f, 0.175f, 1.0f); } final function GetFillScreenSize(out float SizeX, out float SizeY) diff --git a/YAS/Classes/YAS_Types.uc b/YAS/Classes/YAS_Types.uc index f6295c9..93ab17d 100644 --- a/YAS/Classes/YAS_Types.uc +++ b/YAS/Classes/YAS_Types.uc @@ -45,7 +45,6 @@ struct YAS_SettingsLevel struct YAS_Style { // Box shapes - var float EdgeSize; var int ShapeServerNameBox; var int ShapeGameInfoBox; var int ShapeWaveInfoBox; @@ -169,8 +168,6 @@ struct YAS_Style Structdefaultproperties { - EdgeSize = 8.0f - // Box shapes ShapeServerNameBox = 150 ShapeGameInfoBox = 151