diff --git a/external/reshade/shaders/OSD.fx b/external/reshade/shaders/OSD.fx index 07f8204..e740825 100644 --- a/external/reshade/shaders/OSD.fx +++ b/external/reshade/shaders/OSD.fx @@ -18,6 +18,10 @@ uniform bool GodMode_Enabled = false; // Invulnerability uniform bool OSD_ShowInvuln = false; uniform bool Invulnerability_Enabled = false; +// Stealth +uniform bool OSD_ShowStealth = false; +uniform bool Stealth_Enabled = false; + // --- Character arrays for labels --- static const int ON_LENGTH = 2; static float ON_CHARS[32] = { @@ -48,7 +52,7 @@ static float WORLD_CHARS[32] = { }; static const int AI_LEN = 5; static float AI_CHARS[32] = { - 32-32,65-32,73-32,58-32,32-32,0,0,0, + 32-32,65-32,73-32,58-32,32-32,0,0,0, // AI : 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -63,10 +67,18 @@ static float GOD_CHARS[32] = { }; static const int INV_LEN = 12; -static float INV_CHARS[32] = { // 73 103 110 111 114 101 32 104 105 116 115 32 +static float INV_CHARS[32] = { 73-32, 103-32, 110-32, 111-32, 114-32, 101-32, 32-32, 104-32, // "Ignore hits" 105-32, 116-32, 115-32, 32-32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static const int STEALTH_LEN = 13; +static float STEALTH_CHARS[32] = { + 83-32, 116-32, 101-32, 97-32, 108-32, 116-32, 104-32, 32-32, // "Stealth Mode" + 77-32, 111-32, 100-32, 101-32, 32-32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -154,14 +166,12 @@ float4 DrawFlag(float2 uv, inout float2 pen, float2 charSize, const float label[ float4 PS_OSD(float4 pos : SV_Position, float2 uv : TEXCOORD) : SV_Target { float4 col = tex2D(ReShade::BackBuffer, uv); - if (!OSD_ShowTD && !OSD_ShowGodMode && !OSD_ShowInvuln) +if (!OSD_ShowTD && !OSD_ShowGodMode && !OSD_ShowInvuln && !OSD_ShowStealth) return col; float margin_top = 20.0; - float2 screen_size = float2(BUFFER_WIDTH, BUFFER_HEIGHT); - float aspect = screen_size.x/screen_size.y; - float2 center_uv = float2(0.5, margin_top/screen_size.y+0.01); - float2 p = uv - center_uv; p.x *= aspect; + float2 center_uv = float2(0.5, margin_top / ReShade::ScreenSize.y + 0.01); + float2 p = uv - center_uv; p.x *= ReShade::AspectRatio; // --- Frame rect --- float charAdvance = 0.003; @@ -192,17 +202,22 @@ float4 PS_OSD(float4 pos : SV_Position, float2 uv : TEXCOORD) : SV_Target { totalLen = INV_LEN + OFF_LENGTH; color = float3(1.0, 0.3, 0.3); } + if (Stealth_Enabled && OSD_ShowStealth) { + totalLen = STEALTH_LEN + ON_LENGTH; + color = float3(0.3, 1.0, 0.3); + } + if (!Stealth_Enabled && OSD_ShowStealth) { + totalLen = STEALTH_LEN + OFF_LENGTH; + color = float3(1.0, 0.3, 0.3); + } - float2 size_uv = float2((totalLen* charAdvance * 0.5 + charAdvance * 1.0) * aspect, 20.0/screen_size.y); + float2 size_uv = float2((totalLen* charAdvance * 0.5 + charAdvance * 1.0) * ReShade::AspectRatio, 20.0 / ReShade::ScreenSize.y); float thickness_px = 1.0; float thickness = thickness_px * ReShade::PixelSize.y; float radius_px = 2.0; float radius = radius_px * ReShade::PixelSize.y; float d = sdRoundRect(p,size_uv,radius); - if (abs(d)