Add stealth cheat on OSD
This commit is contained in:
44
external/reshade/shaders/OSD.fx
vendored
44
external/reshade/shaders/OSD.fx
vendored
@@ -18,6 +18,10 @@ uniform bool GodMode_Enabled = false;
|
|||||||
// Invulnerability
|
// Invulnerability
|
||||||
uniform bool OSD_ShowInvuln = false;
|
uniform bool OSD_ShowInvuln = false;
|
||||||
uniform bool Invulnerability_Enabled = false;
|
uniform bool Invulnerability_Enabled = false;
|
||||||
|
// Stealth
|
||||||
|
uniform bool OSD_ShowStealth = false;
|
||||||
|
uniform bool Stealth_Enabled = false;
|
||||||
|
|
||||||
// --- Character arrays for labels ---
|
// --- Character arrays for labels ---
|
||||||
static const int ON_LENGTH = 2;
|
static const int ON_LENGTH = 2;
|
||||||
static float ON_CHARS[32] = {
|
static float ON_CHARS[32] = {
|
||||||
@@ -48,7 +52,7 @@ static float WORLD_CHARS[32] = {
|
|||||||
};
|
};
|
||||||
static const int AI_LEN = 5;
|
static const int AI_LEN = 5;
|
||||||
static float AI_CHARS[32] = {
|
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, 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 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"
|
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,
|
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,
|
||||||
|
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
|
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 PS_OSD(float4 pos : SV_Position, float2 uv : TEXCOORD) : SV_Target {
|
||||||
float4 col = tex2D(ReShade::BackBuffer, uv);
|
float4 col = tex2D(ReShade::BackBuffer, uv);
|
||||||
|
|
||||||
if (!OSD_ShowTD && !OSD_ShowGodMode && !OSD_ShowInvuln)
|
if (!OSD_ShowTD && !OSD_ShowGodMode && !OSD_ShowInvuln && !OSD_ShowStealth)
|
||||||
return col;
|
return col;
|
||||||
|
|
||||||
float margin_top = 20.0;
|
float margin_top = 20.0;
|
||||||
float2 screen_size = float2(BUFFER_WIDTH, BUFFER_HEIGHT);
|
float2 center_uv = float2(0.5, margin_top / ReShade::ScreenSize.y + 0.01);
|
||||||
float aspect = screen_size.x/screen_size.y;
|
float2 p = uv - center_uv; p.x *= ReShade::AspectRatio;
|
||||||
float2 center_uv = float2(0.5, margin_top/screen_size.y+0.01);
|
|
||||||
float2 p = uv - center_uv; p.x *= aspect;
|
|
||||||
|
|
||||||
// --- Frame rect ---
|
// --- Frame rect ---
|
||||||
float charAdvance = 0.003;
|
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;
|
totalLen = INV_LEN + OFF_LENGTH;
|
||||||
color = float3(1.0, 0.3, 0.3);
|
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_px = 1.0;
|
||||||
float thickness = thickness_px * ReShade::PixelSize.y;
|
float thickness = thickness_px * ReShade::PixelSize.y;
|
||||||
float radius_px = 2.0;
|
float radius_px = 2.0;
|
||||||
float radius = radius_px * ReShade::PixelSize.y;
|
float radius = radius_px * ReShade::PixelSize.y;
|
||||||
float d = sdRoundRect(p,size_uv,radius);
|
float d = sdRoundRect(p,size_uv,radius);
|
||||||
if (abs(d)<thickness) {
|
if (abs(d)<thickness) col.rgb = lerp(col.rgb, color, 0.85);
|
||||||
//float3 border = TD_Enabled ? float3(0.3,1.0,0.3) : float3(1.0,0.3,0.3);
|
|
||||||
col.rgb = lerp(col.rgb, color, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- Draw all flags ---
|
// --- Draw all flags ---
|
||||||
float2 pen = center_uv;
|
float2 pen = center_uv;
|
||||||
@@ -235,9 +250,8 @@ float4 PS_OSD(float4 pos : SV_Position, float2 uv : TEXCOORD) : SV_Target {
|
|||||||
if (OSD_ShowInvuln)
|
if (OSD_ShowInvuln)
|
||||||
AlphaBlend(combined, DrawFlag(uv, pen, charSize, INV_CHARS, INV_LEN, Invulnerability_Enabled));
|
AlphaBlend(combined, DrawFlag(uv, pen, charSize, INV_CHARS, INV_LEN, Invulnerability_Enabled));
|
||||||
|
|
||||||
|
if (OSD_ShowStealth)
|
||||||
// --- final blend ---
|
AlphaBlend(combined, DrawFlag(uv, pen, charSize, STEALTH_CHARS, STEALTH_LEN, Stealth_Enabled));
|
||||||
//float3 textColor = TD_Enabled ? float3(0.3,1.0,0.3) : float3(1.0,0.3,0.3);
|
|
||||||
|
|
||||||
combined.rgb *= color;
|
combined.rgb *= color;
|
||||||
col.rgb = lerp(col.rgb, combined.rgb, combined.a);
|
col.rgb = lerp(col.rgb, combined.rgb, combined.a);
|
||||||
|
|||||||
Reference in New Issue
Block a user