Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cfg/cs2fixes/cs2fixes.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 17 additions & 1 deletion src/entwatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ SH_DECL_MANUALHOOK1_void(CTriggerMultiple_EndTouch, 0, 0, 0, CBaseEntity*);
CConVar<bool> g_cvarEnableEntWatch("entwatch_enable", FCVAR_NONE, "INCOMPATIBLE WITH CS#. Whether to enable EntWatch features", false);
CConVar<bool> g_cvarEnableFiltering("entwatch_auto_filter", FCVAR_NONE, "Whether to automatically block non-item holders from triggering uses", true);
CConVar<bool> g_cvarUseEntwatchClantag("entwatch_clantag", FCVAR_NONE, "Whether to set item holder's clantag and set score", true);
CConVar<int> 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<CUtlString> g_cvarClantagColour("entwatch_clantag_colour", FCVAR_NONE, "Hex colour (RRGGBB) to use if entwatch_clantag_colour_mode 2", "FFFFFF");
CConVar<int> 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<bool> g_cvarEnableEntwatchHud("entwatch_hud", FCVAR_NONE, "Whether to enable the EntWatch hud and related commands", true);

Expand Down Expand Up @@ -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), "<span color='#%02X%02X%02X'>[%s]%s</span>",
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), "<span color='#%s'>[%s]%s</span>",
g_cvarClantagColour.Get().String(), sItemText.c_str(), pItem->szShortName.c_str());
break;
}
if (pItem->bHasThisClantag)
pOwner->SetClanTag(pItem->sClantag);
}
Expand Down