From 2c8d1e3bb7832283120236bef6b48da902ae2e46 Mon Sep 17 00:00:00 2001 From: mourningsickness Date: Mon, 11 Aug 2025 13:42:30 -0700 Subject: [PATCH 1/3] shavit-hud.sp - add perf% to center hud if on scroll style and HUD2_PERFS is enabled --- addons/sourcemod/scripting/shavit-hud.sp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/addons/sourcemod/scripting/shavit-hud.sp b/addons/sourcemod/scripting/shavit-hud.sp index c50b421fb..6da47b0c1 100644 --- a/addons/sourcemod/scripting/shavit-hud.sp +++ b/addons/sourcemod/scripting/shavit-hud.sp @@ -1369,7 +1369,15 @@ int AddHUDToBuffer_Source2013(int client, huddata_t data, char[] buffer, int max if((gI_HUD2Settings[client] & HUD2_JUMPS) == 0) { - FormatEx(sLine, 128, "%T: %d", "HudJumpsText", client, data.iJumps); + if (!Shavit_GetStyleSettingBool(data.iStyle, "autobhop") && (gI_HUD2Settings[client] & HUD2_PERFS) == 0) + { + FormatEx(sLine, 128, "%T: %d (%.1f%)", "HudJumpsText", client, data.iJumps, Shavit_GetPerfectJumps(data.iTarget)); + } + else + { + FormatEx(sLine, 128, "%T: %d", "HudJumpsText", client, data.iJumps); + } + AddHUDLine(buffer, maxlen, sLine, iLines); } From 0bdcd88199d437008f79167b5eb9e5a667e445b5 Mon Sep 17 00:00:00 2001 From: mourningsickness Date: Mon, 11 Aug 2025 18:17:53 -0700 Subject: [PATCH 2/3] shavit-hud.sp - change % in message to the other percent character lol --- addons/sourcemod/scripting/shavit-hud.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sourcemod/scripting/shavit-hud.sp b/addons/sourcemod/scripting/shavit-hud.sp index 6da47b0c1..1a4d0d426 100644 --- a/addons/sourcemod/scripting/shavit-hud.sp +++ b/addons/sourcemod/scripting/shavit-hud.sp @@ -1371,7 +1371,7 @@ int AddHUDToBuffer_Source2013(int client, huddata_t data, char[] buffer, int max { if (!Shavit_GetStyleSettingBool(data.iStyle, "autobhop") && (gI_HUD2Settings[client] & HUD2_PERFS) == 0) { - FormatEx(sLine, 128, "%T: %d (%.1f%)", "HudJumpsText", client, data.iJumps, Shavit_GetPerfectJumps(data.iTarget)); + FormatEx(sLine, 128, "%T: %d (%.1f%)", "HudJumpsText", client, data.iJumps, Shavit_GetPerfectJumps(data.iTarget)); } else { From c247d690ae346379574d3a5e6b5694ee2781d501 Mon Sep 17 00:00:00 2001 From: rtldg Date: Tue, 7 Oct 2025 23:50:53 +0000 Subject: [PATCH 3/3] Add HUD_PERFS_CENTER --- addons/sourcemod/scripting/include/shavit/hud.inc | 1 + addons/sourcemod/scripting/shavit-hud.sp | 7 ++++++- addons/sourcemod/translations/shavit-hud.phrases.txt | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/sourcemod/scripting/include/shavit/hud.inc b/addons/sourcemod/scripting/include/shavit/hud.inc index b08a03c92..965052f93 100644 --- a/addons/sourcemod/scripting/include/shavit/hud.inc +++ b/addons/sourcemod/scripting/include/shavit/hud.inc @@ -42,6 +42,7 @@ #define HUD_GLOCK (1 << 14) // makes you spawn with a Glock #define HUD_DEBUGTARGETNAME (1 << 15) // admin option to show current targetname & classname #define HUD_SPECTATORSDEAD (1 << 16) // for only showing spectators list when you're dead/spectating. +#define HUD_PERFS_CENTER (1 << 17) // for the perf percentage in the center hud. e.g. "Jumps: 20 (66.6%)" // HUD2 - these settings will *disable* elements for the main hud #define HUD2_TIME (1 << 0) diff --git a/addons/sourcemod/scripting/shavit-hud.sp b/addons/sourcemod/scripting/shavit-hud.sp index 1a4d0d426..bc0476faa 100644 --- a/addons/sourcemod/scripting/shavit-hud.sp +++ b/addons/sourcemod/scripting/shavit-hud.sp @@ -209,6 +209,7 @@ public void OnPluginStart() ..."HUD_USP 8192\n" ..."HUD_GLOCK 16384\n" ..."HUD_SPECTATORSDEAD 65536\n" + ..."HUD_PERFS_CENTER 131072\n" ); IntToString(HUD_DEFAULT2, defaultHUD, 8); @@ -776,6 +777,10 @@ Action ShowHUDMenu(int client, int item) FormatEx(sHudItem, 64, "%T", "HudPerfs", client); menu.AddItem(sInfo, sHudItem); + FormatEx(sInfo, 16, "!%d", HUD_PERFS_CENTER); + FormatEx(sHudItem, 64, "%T", "HudPerfsCenter", client); + menu.AddItem(sInfo, sHudItem); + FormatEx(sInfo, 16, "@%d", HUD2_STYLE); FormatEx(sHudItem, 64, "%T", "HudStyleText", client); menu.AddItem(sInfo, sHudItem); @@ -1369,7 +1374,7 @@ int AddHUDToBuffer_Source2013(int client, huddata_t data, char[] buffer, int max if((gI_HUD2Settings[client] & HUD2_JUMPS) == 0) { - if (!Shavit_GetStyleSettingBool(data.iStyle, "autobhop") && (gI_HUD2Settings[client] & HUD2_PERFS) == 0) + if (!Shavit_GetStyleSettingBool(data.iStyle, "autobhop") && (gI_HUDSettings[client] & HUD_PERFS_CENTER)) { FormatEx(sLine, 128, "%T: %d (%.1f%)", "HudJumpsText", client, data.iJumps, Shavit_GetPerfectJumps(data.iTarget)); } diff --git a/addons/sourcemod/translations/shavit-hud.phrases.txt b/addons/sourcemod/translations/shavit-hud.phrases.txt index dea5c8795..020e20b49 100644 --- a/addons/sourcemod/translations/shavit-hud.phrases.txt +++ b/addons/sourcemod/translations/shavit-hud.phrases.txt @@ -85,6 +85,10 @@ { "en" "Perfect jumps" } + "HudPerfsCenter" + { + "en" "Perfect jumps (center hud)" + } "HudDefaultPistol" { "en" "Default Pistol: 1=USP 2=Glock"