From 570d6800b638fe5a65815ff5d1782e3810b86e4d Mon Sep 17 00:00:00 2001 From: tilgep Date: Thu, 20 Aug 2026 20:10:24 +0100 Subject: [PATCH] EntWatch clantag colours --- cfg/cs2fixes/cs2fixes.cfg | 2 ++ src/entwatch.cpp | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/cfg/cs2fixes/cs2fixes.cfg b/cfg/cs2fixes/cs2fixes.cfg index 3a7b746b..35d00599 100644 --- a/cfg/cs2fixes/cs2fixes.cfg +++ b/cfg/cs2fixes/cs2fixes.cfg @@ -160,6 +160,8 @@ cs2f_enable_button_watch 0 // INCOMPATIBLE WITH CS#. Whether to enable button entwatch_enable 0 // INCOMPATIBLE WITH CS#. Whether to enable EntWatch features entwatch_auto_filter 1 // Whether to automatically block non-item holders from triggering uses entwatch_clantag 1 // Whether to set item holder's clantag and set 9999 score +entwatch_clantag_colour_mode 1 // Whether to set item clantag colours (0=No colour, 1=Use item colour, 2=Use entwatch_clantag_colour value) +entwatch_clantag_colour "FFFFFF" // Hex colour (RRGGBB) to use if entwatch_clantag_colour_mode 2 entwatch_hud 1 // Whether to enable the EntWatch hud and related commands entwatch_score 9999 // Score to give item holders (0 = dont change score at all) Requires entwatch_clantag 1 entwatch_glow 1000 // Distance that dropped item weapon glow will be visible (0 = glow disabled) diff --git a/src/entwatch.cpp b/src/entwatch.cpp index 0ae9d07f..c4d827c3 100644 --- a/src/entwatch.cpp +++ b/src/entwatch.cpp @@ -72,6 +72,8 @@ SH_DECL_MANUALHOOK1_void(CTriggerMultiple_EndTouch, 0, 0, 0, CBaseEntity*); CConVar g_cvarEnableEntWatch("entwatch_enable", FCVAR_NONE, "INCOMPATIBLE WITH CS#. Whether to enable EntWatch features", false); CConVar g_cvarEnableFiltering("entwatch_auto_filter", FCVAR_NONE, "Whether to automatically block non-item holders from triggering uses", true); CConVar g_cvarUseEntwatchClantag("entwatch_clantag", FCVAR_NONE, "Whether to set item holder's clantag and set score", true); +CConVar g_cvarClantagColourMode("entwatch_clantag_colour_mode", FCVAR_NONE, "Whether to set item clantag colours (0=No colour, 1=Use item colour, 2=Use entwatch_clantag_colour value)", 1, true, 0, true, 2); +CConVar g_cvarClantagColour("entwatch_clantag_colour", FCVAR_NONE, "Hex colour (RRGGBB) to use if entwatch_clantag_colour_mode 2", "FFFFFF"); CConVar g_cvarItemHolderScore("entwatch_score", FCVAR_NONE, "Score to give item holders (0 = dont change score at all) Requires entwatch_clantag 1", 9999, true, 0, false, 0); CConVar g_cvarEnableEntwatchHud("entwatch_hud", FCVAR_NONE, "Whether to enable the EntWatch hud and related commands", true); @@ -1988,7 +1990,21 @@ float EW_UpdateHud() if (g_cvarUseEntwatchClantag.Get()) { - V_snprintf(pItem->sClantag, sizeof(EWItemInstance::sClantag), "[%s]%s:", sItemText.c_str(), pItem->szShortName.c_str()); + switch (g_cvarClantagColourMode.Get()) + { + case 0: + V_snprintf(pItem->sClantag, sizeof(EWItemInstance::sClantag), "[%s]%s:", + sItemText.c_str(), pItem->szShortName.c_str()); + break; + case 1: + V_snprintf(pItem->sClantag, sizeof(EWItemInstance::sClantag), "[%s]%s", + pItem->colorGlow.r(), pItem->colorGlow.g(), pItem->colorGlow.b(), sItemText.c_str(), pItem->szShortName.c_str()); + break; + case 2: + V_snprintf(pItem->sClantag, sizeof(EWItemInstance::sClantag), "[%s]%s", + g_cvarClantagColour.Get().String(), sItemText.c_str(), pItem->szShortName.c_str()); + break; + } if (pItem->bHasThisClantag) pOwner->SetClanTag(pItem->sClantag); }