From 95675a870aaa30a47fbf3d6a39cdf404dfea245c Mon Sep 17 00:00:00 2001 From: tilgep Date: Sun, 22 Nov 2026 17:28:56 +0000 Subject: [PATCH 1/2] Update Entwatch Hud to use custom_hud_layout Also added a new settings menu to change EntWatch hud settings, accessible with !hud --- .../custom_game/cs2fixes/entwatch_hud.vxml_c | Bin 0 -> 5041 bytes .../cs2fixes/entwatch_settings.vxml_c | Bin 0 -> 3946 bytes .../cs2fixes/entwatch_common.vcss_c | Bin 0 -> 4902 bytes .../custom_game/cs2fixes/entwatch_hud.vcss_c | Bin 0 -> 16997 bytes .../cs2fixes/entwatch_settings.vcss_c | Bin 0 -> 11739 bytes .../custom_game/cs2fixes/entwatch_hud.xml | 333 +++++++++++++ .../cs2fixes/entwatch_settings.xml | 191 ++++++++ .../custom_game/cs2fixes/entwatch_common.css | 64 +++ .../custom_game/cs2fixes/entwatch_hud.css | 291 ++++++++++++ .../cs2fixes/entwatch_settings.css | 310 ++++++++++++ src/entwatch.cpp | 441 ++++++++++++++---- src/entwatch.h | 60 ++- src/events.cpp | 21 + src/playermanager.cpp | 249 ++++------ src/playermanager.h | 50 +- src/user_preferences.cpp | 21 +- src/virtual_hooks.cpp | 8 - 17 files changed, 1721 insertions(+), 318 deletions(-) create mode 100644 assets/panorama/layout/custom_game/cs2fixes/entwatch_hud.vxml_c create mode 100644 assets/panorama/layout/custom_game/cs2fixes/entwatch_settings.vxml_c create mode 100644 assets/panorama/styles/custom_game/cs2fixes/entwatch_common.vcss_c create mode 100644 assets/panorama/styles/custom_game/cs2fixes/entwatch_hud.vcss_c create mode 100644 assets/panorama/styles/custom_game/cs2fixes/entwatch_settings.vcss_c create mode 100644 assets_source/panorama/layout/custom_game/cs2fixes/entwatch_hud.xml create mode 100644 assets_source/panorama/layout/custom_game/cs2fixes/entwatch_settings.xml create mode 100644 assets_source/panorama/styles/custom_game/cs2fixes/entwatch_common.css create mode 100644 assets_source/panorama/styles/custom_game/cs2fixes/entwatch_hud.css create mode 100644 assets_source/panorama/styles/custom_game/cs2fixes/entwatch_settings.css diff --git a/assets/panorama/layout/custom_game/cs2fixes/entwatch_hud.vxml_c b/assets/panorama/layout/custom_game/cs2fixes/entwatch_hud.vxml_c new file mode 100644 index 0000000000000000000000000000000000000000..a3e7d4cddf56ee7584ba966e72c851d626f5e2d6 GIT binary patch literal 5041 zcma)=34D|F9map}o1KF^cy_su`=|4s5A5VH@ z{kXl#vDYiP!hV(!SeAfUhM7gSsc|dlM>EELiNX2E3s{C>#-qIdc_^L}5N>A@av;*% z-VloP>9tx!3w3Luu7DPk-u4zP=+grWwJCw17V`CK67hw?QD3jGDCk=f?$e99`eJ&x zw|yR7E9#1s_5>Ddu_7&`FY@VK{&s&~_vnR-dxKb0tLBS#`I~*ZU%F!R!tK89?rb{m?5Sy~0d+P-^guY|E0?rRw{+Ak4#f0Ws+`dfo9gRbD~>hdRaZ-ORd;uw zT^wJCvaBjPudi1Nx#fmtA2v;ReK~fP1!u@yvl8)dQkPHOViYu2ppVOTyIhnvrac0dGXSPk8IW{?9#UdGm z3`RVN7s3OZ9Fmr86|X%zN%q)mw#l>voYl`FVcwXvSxmlPEIdUXf-Tz{&mZE8|AvVa4a( zgymLzJv(vi9T?o(Ue(%${UXv54(p;BdtFOYQ=2T*x@!3A;&+tRwmFS;tOM|ZUw(358xy)?zb!tJE3>#H!7jv0hpkuTwjZGLR?(;^9 zyTmT;QltzSgOnpL{P+~if^J^(n~zzD)r!_dL$ijVZX~n z(h=7fFp`eA%E3rF;u;G^(h=78$8wE2Ms>W;AahQ;0Ad!LM3zB`Wh zk+U$Td6LC8*^*Rgabj|J`H4w~C;YGh6XW=dIPQt#r3vbOOaG+nR2}wrmND7jQIFK}CfK6}(b2@<;$Uww}xRFdG3+cbu zICH^+kim!t@gjLhJ~9L;K!zg2kl{!nauPBEIT;y=j6y~uMMyDHf|Md<$QYy?8HiO+JHhk7esB+X0XPVr4-SJP;1DQyk@CNV|;A_Ae z!B>N?1#bp#0$&fl0el_!X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bZy(G6=9=5M z_za-l`z6c|ank&SHp5Jz(p;-o)|Kaes#lp$p~QRw#oi^Fx#r3uG-ST#F7EcoKmWe~ Di6=&3 literal 0 HcmV?d00001 diff --git a/assets/panorama/styles/custom_game/cs2fixes/entwatch_common.vcss_c b/assets/panorama/styles/custom_game/cs2fixes/entwatch_common.vcss_c new file mode 100644 index 0000000000000000000000000000000000000000..260c379970c8e17260bf0b6d350995d4a2901ed4 GIT binary patch literal 4902 zcmaKvdvFui6~@m>vMk$@CA>y5V5njYfz-gRUY5ZSzer(Xim@ExBy_|gt!x#&vMV`I zpoOIEbQ(869|;NhBke#Yoi>w4p_62ihIY~!nlPklv22F3yCpQ*KmGXdEQVVIdkjkn$<&(o|PAO+6)Z4N-wV>ox zDk+7crsS1XdU7h(^7mRA5e4kQIjVDvZe7;y%nbHU8a$`bO zwAA>JQXZ$2K2}UB>2$Gx2*tFzD;cIa+Bi)mLsBRvbxBdoUD!v{)IZ#hw>vhM%GqK; z$+?LFw0-@qtX|d|Y0F0aGfMs`@*bnbO%unduQ#2}rpW6RguT7mSS7C(0`$a?f`rww zs(p5`@O(0v+&rObS~jf?(6~}oU|2>M>?6BND)nUxinhBiSKI;bb9A&YrfMZETPS;} zG@xdbO0K+K*jZ9jStWOX9!QkI#%Sm&O$CQEwWJkOs;(C`4_$25Q9^aqR#nrHH&)PJ z%$HC@Z6j)1&StWzMj|=-i4IWD9lEN$Le5e0CAJ97!FA*hZXx?4)EE(5!-BBM7F5&6 z1fTvD)MGrGOAo7hv7)8a!L0sAI(et6>>O4zs-_m2$riV*S9avo!?b*(zLwDEN@a(l z>uPx|`SrO(w+d6)LY5U%r<>6DL<3%&4hlFN^ewi#Yy!3p%3M#Py_NRYz|{G4@lO#- z82hE27Sy$qD@bkiY%`YV;(Un7gS!#87q<`h9NbN~@iuGFsd8y6ob<(r|tJj6A4t=J# zKfDJ0^{f0{;R{4PX*H8AsKN0{dPS<3D{3pG)xpJ?nQP7eV;MLuvA;}a7929XC0w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vnL6gL4Td4#ihDCE1Hzplgeo@cAJ7{jIB?*8s!9p$7I3`+osXLuH8o literal 0 HcmV?d00001 diff --git a/assets/panorama/styles/custom_game/cs2fixes/entwatch_hud.vcss_c b/assets/panorama/styles/custom_game/cs2fixes/entwatch_hud.vcss_c new file mode 100644 index 0000000000000000000000000000000000000000..1a1ee48124e11de3751b4900ca825db13a6f68b3 GIT binary patch literal 16997 zcmb`O3wTu3wa52KLP*GC&g6tlc!)y?N#v1aUYQASEiY}*sF4{TxkX`;Ovu#9qca17 zV4GHaR8g_D6*ab~v_-|1Dz>(wrnjj0sG_Bc6|1e-mx{DfOIup+f2}QutS?rKc@+&qC?K#o`5_1uIZKRiRWcepa}8qEh4Q zP$_=Kc+Nj_eMMRF5BZx<|K6W}d+I}*{J%4F{rnu)bl>em8j z4?$do&$F;W#y`GPIUVI#e28-#K8IU-moMoXSe0BH8Hn_CMfy6Uk%a19zBCdGC!?z) zr$=LvzHo0u4TSspwPg^+IqdF5S`WZ#Vw)d5>enEWYs@_PSLv3jb zgDsMb#Lvz(9$3D7`8lg2@p!Z=vRL(mlVKR@)CW1CwF42gFxnT6uU#1H?^qCjTixEb zG7=w%NBfdCHLy6+9bOen))|)!L^`A4*cVk}Fd09^u-ZOUd!23Z$UwZmGm=R3$4k@) zgES0xNsV}Pe=OrTXM^*lX$_$=ulsivV z70z>2?k%d+YZNRsjM+KPNY|Z)nYa?Y(G!hzEsZ4lSH(LctcI;l;Y*fAx+C#O zU%9e9V@$fHv%j~uzpsAvc{!(rJ7SS%)hSC7mnt<~ty7u2>;~gDMwzOx|ya_j*(+v-hxu)PF90sQ2zALb9Z`GkS9sCnp9Y=3Y@BH z9L>N1^}$4pjw->Y6dxNtCO&q2%J8x9DaQwqRmEgwIV#np%1UJw;r9v4lr^zHS(6IX z;rz)EoP^I5d``y4iO|TddUlXzxIOJn38&kJVKr-0?XL4gb4&o9@`oM55}Hx%0as-O;{? zGv0sc?4C$;WlwUB)6+PxW^Vn`{{G~;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HllWMha=jO*P|;k~+av`SS*@@e)0MV0DZZdN}^$*+&J3;%6E7h&5!0_wrG zqc2jO$GG>O{CFd+|=N1tt!QV$NlRb!e z39Uj`DaNX6oTt!q0z_DZR)f|m&v4gi<1JC`JLq8ZUg6xkR8cv4t&-SeQ&lN_vLH}S zLOmWg-N1#Mr7wF!RvwD=Sm{qj{|C;cJDLCh literal 0 HcmV?d00001 diff --git a/assets_source/panorama/layout/custom_game/cs2fixes/entwatch_hud.xml b/assets_source/panorama/layout/custom_game/cs2fixes/entwatch_hud.xml new file mode 100644 index 00000000..b048112d --- /dev/null +++ b/assets_source/panorama/layout/custom_game/cs2fixes/entwatch_hud.xml @@ -0,0 +1,333 @@ + + + + + + + + diff --git a/assets_source/panorama/layout/custom_game/cs2fixes/entwatch_settings.xml b/assets_source/panorama/layout/custom_game/cs2fixes/entwatch_settings.xml new file mode 100644 index 00000000..eae8ae8c --- /dev/null +++ b/assets_source/panorama/layout/custom_game/cs2fixes/entwatch_settings.xml @@ -0,0 +1,191 @@ + + + + + + + + diff --git a/assets_source/panorama/styles/custom_game/cs2fixes/entwatch_common.css b/assets_source/panorama/styles/custom_game/cs2fixes/entwatch_common.css new file mode 100644 index 00000000..b77c1731 --- /dev/null +++ b/assets_source/panorama/styles/custom_game/cs2fixes/entwatch_common.css @@ -0,0 +1,64 @@ +@define hud-color-0: #ffffffff; /* White */ +@define hud-color-1: #808080ff; /* Gray */ +@define hud-color-2: #ff0000ff; /* Red */ +@define hud-color-3: #ff8060ff; /* Coral */ +@define hud-color-4: #ff8000ff; /* Orange */ +@define hud-color-5: #ffff00ff; /* Yellow */ +@define hud-color-6: #80D000ff; /* Olive */ +@define hud-color-7: #00ff00ff; /* Lime */ +@define hud-color-8: #00ff80ff; /* Emerald */ +@define hud-color-9: #80ffc0ff; /* Mint */ +@define hud-color-10: #00ffffff; /* Cyan */ +@define hud-color-11: #80c0ffff; /* Sky */ +@define hud-color-12: #0080ffff; /* Blue */ +@define hud-color-13: #0000ffff; /* Navy */ +@define hud-color-14: #8000ffff; /* Purple */ +@define hud-color-15: #c080ffff; /* Lavender */ +@define hud-color-16: #ff00ffff; /* Magenta */ +@define hud-color-17: #ff0080ff; /* Rose */ +@define hud-color-18: #ff80c0ff; /* Pink */ +@define hud-color-19: #804000ff; /* Brown */ + + +.HudColour-0 { wash-color: hud-color-0; } +.HudColour-1 { wash-color: hud-color-1; } +.HudColour-2 { wash-color: hud-color-2; } +.HudColour-3 { wash-color: hud-color-3; } +.HudColour-4 { wash-color: hud-color-4; } +.HudColour-5 { wash-color: hud-color-5; } +.HudColour-6 { wash-color: hud-color-6; } +.HudColour-7 { wash-color: hud-color-7; } +.HudColour-8 { wash-color: hud-color-8; } +.HudColour-9 { wash-color: hud-color-9; } +.HudColour-10 { wash-color: hud-color-10; } +.HudColour-11 { wash-color: hud-color-11; } +.HudColour-12 { wash-color: hud-color-12; } +.HudColour-13 { wash-color: hud-color-13; } +.HudColour-14 { wash-color: hud-color-14; } +.HudColour-15 { wash-color: hud-color-15; } +.HudColour-16 { wash-color: hud-color-16; } +.HudColour-17 { wash-color: hud-color-17; } +.HudColour-18 { wash-color: hud-color-18; } +.HudColour-19 { wash-color: hud-color-19; } + +.Scale-50 {ui-scale:50%;} +.Scale-55 {ui-scale:55%;} +.Scale-60 {ui-scale:60%;} +.Scale-65 {ui-scale:65%;} +.Scale-70 {ui-scale:70%;} +.Scale-75 {ui-scale:75%;} +.Scale-80 {ui-scale:80%;} +.Scale-85 {ui-scale:85%;} +.Scale-90 {ui-scale:90%;} +.Scale-95 {ui-scale:95%;} +.Scale-100 {ui-scale:100%;} +.Scale-105 {ui-scale:105%;} +.Scale-110 {ui-scale:110%;} +.Scale-115 {ui-scale:115%;} +.Scale-120 {ui-scale:120%;} +.Scale-125 {ui-scale:125%;} +.Scale-130 {ui-scale:130%;} +.Scale-135 {ui-scale:135%;} +.Scale-140 {ui-scale:140%;} +.Scale-145 {ui-scale:145%;} +.Scale-150 {ui-scale:150%;} diff --git a/assets_source/panorama/styles/custom_game/cs2fixes/entwatch_hud.css b/assets_source/panorama/styles/custom_game/cs2fixes/entwatch_hud.css new file mode 100644 index 00000000..5e6a719c --- /dev/null +++ b/assets_source/panorama/styles/custom_game/cs2fixes/entwatch_hud.css @@ -0,0 +1,291 @@ +@import url("file://{resources}/styles/custom_game/cs2fixes/entwatch_common.css"); +@define row-height: 30px; + +.Root { + width: 100%; + height: 100%; +} +.HudTextPanel { + opacity: 1; + flow-children: right; + width:fit-children; + overflow: noclip noclip; +} +.HudTextPanel.Hidden { + opacity: 0; +} +.ItemStateColumn { + font-size: 32px; + width: 20px; + margin-right: 10px; + flow-children:down; + overflow: noclip noclip; +} +.ItemNamesColumn { + width:fit-children; + flow-children:down; +} +.Item { + flow-children:right; + visibility: visible; +} +.Item.Hidden { + visibility: collapse; +} +Label { + color: #ffffff; + font-size: 28px; +} +.ItemState { + font-family: 'Stratum2 bold monodigit', 'Arial Unicode MS'; + horizontal-align:right; + text-align: right; + height:row-height; + color: #000; + visibility: visible; + overflow: noclip noclip; + text-overflow: noclip; +} +.ItemState.Hidden { + visibility: collapse; +} +.ItemName { + font-family: 'Stratum2 bold monodigit', 'Arial Unicode MS'; + height:row-height; + margin-right: 11px; + text-shadow: 0px 0px 3px 2.0 #000000ff; + overflow: noclip noclip; + text-overflow: noclip; +} +.ItemPlayer { + font-family: 'Stratum2', 'Arial Unicode MS'; + height:row-height; + text-shadow: 0px 0px 3px 2.0 #000000ff; + visibility: visible; + overflow: noclip noclip; + text-overflow: noclip; +} +.ItemPlayer.Hidden { + visibility: collapse; +} + +/* Item State Text Shadow Colours */ +.HudColourShadow-1 { text-shadow: 0px 0px 3px 2.0 #ffffff; } +.HudColourShadow-2 { text-shadow: 0px 0px 3px 2.0 #e60000; } +.HudColourShadow-3 { text-shadow: 0px 0px 3px 2.0 #b882f2; } +.HudColourShadow-4 { text-shadow: 0px 0px 3px 2.0 #1eff1e; } +.HudColourShadow-5 { text-shadow: 0px 0px 3px 2.0 #b2ff91; } +.HudColourShadow-6 { text-shadow: 0px 0px 3px 2.0 #b8dc3f; } +.HudColourShadow-7 { text-shadow: 0px 0px 3px 2.0 #ff4141; } +.HudColourShadow-8 { text-shadow: 0px 0px 3px 2.0 #afb4b4; } +.HudColourShadow-9 { text-shadow: 0px 0px 3px 2.0 #fafa19; } +.HudColourShadow-10 { text-shadow: 0px 0px 3px 2.0 #a5b4d2; } +.HudColourShadow-11 { text-shadow: 0px 0px 3px 2.0 #72bcff; } +.HudColourShadow-12 { text-shadow: 0px 0px 3px 2.0 #3755ff; } +/* 13 is a duplicate of 10 */ +.HudColourShadow-14 { text-shadow: 0px 0px 3px 2.0 #d22be5; } +.HudColourShadow-15 { text-shadow: 0px 0px 3px 2.0 #e67878; } +.HudColourShadow-16 { text-shadow: 0px 0px 3px 2.0 #eb912e; } + +/* Hud Position */ +.HudPosX0 { x: 0%;} +.HudPosX1 { x: 1%;} +.HudPosX2 { x: 2%;} +.HudPosX3 { x: 3%;} +.HudPosX4 { x: 4%;} +.HudPosX5 { x: 5%;} +.HudPosX6 { x: 6%;} +.HudPosX7 { x: 7%;} +.HudPosX8 { x: 8%;} +.HudPosX9 { x: 9%;} +.HudPosX10 { x: 10%;} +.HudPosX11 { x: 11%;} +.HudPosX12 { x: 12%;} +.HudPosX13 { x: 13%;} +.HudPosX14 { x: 14%;} +.HudPosX15 { x: 15%;} +.HudPosX16 { x: 16%;} +.HudPosX17 { x: 17%;} +.HudPosX18 { x: 18%;} +.HudPosX19 { x: 19%;} +.HudPosX20 { x: 20%;} +.HudPosX21 { x: 21%;} +.HudPosX22 { x: 22%;} +.HudPosX23 { x: 23%;} +.HudPosX24 { x: 24%;} +.HudPosX25 { x: 25%;} +.HudPosX26 { x: 26%;} +.HudPosX27 { x: 27%;} +.HudPosX28 { x: 28%;} +.HudPosX29 { x: 29%;} +.HudPosX30 { x: 30%;} +.HudPosX31 { x: 31%;} +.HudPosX32 { x: 32%;} +.HudPosX33 { x: 33%;} +.HudPosX34 { x: 34%;} +.HudPosX35 { x: 35%;} +.HudPosX36 { x: 36%;} +.HudPosX37 { x: 37%;} +.HudPosX38 { x: 38%;} +.HudPosX39 { x: 39%;} +.HudPosX40 { x: 40%;} +.HudPosX41 { x: 41%;} +.HudPosX42 { x: 42%;} +.HudPosX43 { x: 43%;} +.HudPosX44 { x: 44%;} +.HudPosX45 { x: 45%;} +.HudPosX46 { x: 46%;} +.HudPosX47 { x: 47%;} +.HudPosX48 { x: 48%;} +.HudPosX49 { x: 49%;} +.HudPosX50 { x: 50%;} +.HudPosX51 { x: 51%;} +.HudPosX52 { x: 52%;} +.HudPosX53 { x: 53%;} +.HudPosX54 { x: 54%;} +.HudPosX55 { x: 55%;} +.HudPosX56 { x: 56%;} +.HudPosX57 { x: 57%;} +.HudPosX58 { x: 58%;} +.HudPosX59 { x: 59%;} +.HudPosX60 { x: 60%;} +.HudPosX61 { x: 61%;} +.HudPosX62 { x: 62%;} +.HudPosX63 { x: 63%;} +.HudPosX64 { x: 64%;} +.HudPosX65 { x: 65%;} +.HudPosX66 { x: 66%;} +.HudPosX67 { x: 67%;} +.HudPosX68 { x: 68%;} +.HudPosX69 { x: 69%;} +.HudPosX70 { x: 70%;} +.HudPosX71 { x: 71%;} +.HudPosX72 { x: 72%;} +.HudPosX73 { x: 73%;} +.HudPosX74 { x: 74%;} +.HudPosX75 { x: 75%;} +.HudPosX76 { x: 76%;} +.HudPosX77 { x: 77%;} +.HudPosX78 { x: 78%;} +.HudPosX79 { x: 79%;} +.HudPosX80 { x: 80%;} +.HudPosX81 { x: 81%;} +.HudPosX82 { x: 82%;} +.HudPosX83 { x: 83%;} +.HudPosX84 { x: 84%;} +.HudPosX85 { x: 85%;} +.HudPosX86 { x: 86%;} +.HudPosX87 { x: 87%;} +.HudPosX88 { x: 88%;} +.HudPosX89 { x: 89%;} +.HudPosX90 { x: 90%;} +.HudPosX91 { x: 91%;} +.HudPosX92 { x: 92%;} +.HudPosX93 { x: 93%;} +.HudPosX94 { x: 94%;} +.HudPosX95 { x: 95%;} +.HudPosX96 { x: 96%;} +.HudPosX97 { x: 97%;} +.HudPosX98 { x: 98%;} +.HudPosX99 { x: 99%;} + +.HudPosY0 { y: 0%;} +.HudPosY1 { y: 1%;} +.HudPosY2 { y: 2%;} +.HudPosY3 { y: 3%;} +.HudPosY4 { y: 4%;} +.HudPosY5 { y: 5%;} +.HudPosY6 { y: 6%;} +.HudPosY7 { y: 7%;} +.HudPosY8 { y: 8%;} +.HudPosY9 { y: 9%;} +.HudPosY10 { y: 10%;} +.HudPosY11 { y: 11%;} +.HudPosY12 { y: 12%;} +.HudPosY13 { y: 13%;} +.HudPosY14 { y: 14%;} +.HudPosY15 { y: 15%;} +.HudPosY16 { y: 16%;} +.HudPosY17 { y: 17%;} +.HudPosY18 { y: 18%;} +.HudPosY19 { y: 19%;} +.HudPosY20 { y: 20%;} +.HudPosY21 { y: 21%;} +.HudPosY22 { y: 22%;} +.HudPosY23 { y: 23%;} +.HudPosY24 { y: 24%;} +.HudPosY25 { y: 25%;} +.HudPosY26 { y: 26%;} +.HudPosY27 { y: 27%;} +.HudPosY28 { y: 28%;} +.HudPosY29 { y: 29%;} +.HudPosY30 { y: 30%;} +.HudPosY31 { y: 31%;} +.HudPosY32 { y: 32%;} +.HudPosY33 { y: 33%;} +.HudPosY34 { y: 34%;} +.HudPosY35 { y: 35%;} +.HudPosY36 { y: 36%;} +.HudPosY37 { y: 37%;} +.HudPosY38 { y: 38%;} +.HudPosY39 { y: 39%;} +.HudPosY40 { y: 40%;} +.HudPosY41 { y: 41%;} +.HudPosY42 { y: 42%;} +.HudPosY43 { y: 43%;} +.HudPosY44 { y: 44%;} +.HudPosY45 { y: 45%;} +.HudPosY46 { y: 46%;} +.HudPosY47 { y: 47%;} +.HudPosY48 { y: 48%;} +.HudPosY49 { y: 49%;} +.HudPosY50 { y: 50%;} +.HudPosY51 { y: 51%;} +.HudPosY52 { y: 52%;} +.HudPosY53 { y: 53%;} +.HudPosY54 { y: 54%;} +.HudPosY55 { y: 55%;} +.HudPosY56 { y: 56%;} +.HudPosY57 { y: 57%;} +.HudPosY58 { y: 58%;} +.HudPosY59 { y: 59%;} +.HudPosY60 { y: 60%;} +.HudPosY61 { y: 61%;} +.HudPosY62 { y: 62%;} +.HudPosY63 { y: 63%;} +.HudPosY64 { y: 64%;} +.HudPosY65 { y: 65%;} +.HudPosY66 { y: 66%;} +.HudPosY67 { y: 67%;} +.HudPosY68 { y: 68%;} +.HudPosY69 { y: 69%;} +.HudPosY70 { y: 70%;} +.HudPosY71 { y: 71%;} +.HudPosY72 { y: 72%;} +.HudPosY73 { y: 73%;} +.HudPosY74 { y: 74%;} +.HudPosY75 { y: 75%;} +.HudPosY76 { y: 76%;} +.HudPosY77 { y: 77%;} +.HudPosY78 { y: 78%;} +.HudPosY79 { y: 79%;} +.HudPosY80 { y: 80%;} +.HudPosY81 { y: 81%;} +.HudPosY82 { y: 82%;} +.HudPosY83 { y: 83%;} +.HudPosY84 { y: 84%;} +.HudPosY85 { y: 85%;} +.HudPosY86 { y: 86%;} +.HudPosY87 { y: 87%;} +.HudPosY88 { y: 88%;} +.HudPosY89 { y: 89%;} +.HudPosY90 { y: 90%;} +.HudPosY91 { y: 91%;} +.HudPosY92 { y: 92%;} +.HudPosY93 { y: 93%;} +.HudPosY94 { y: 94%;} +.HudPosY95 { y: 95%;} +.HudPosY96 { y: 96%;} +.HudPosY97 { y: 97%;} +.HudPosY98 { y: 98%;} +.HudPosY99 { y: 99%;} diff --git a/assets_source/panorama/styles/custom_game/cs2fixes/entwatch_settings.css b/assets_source/panorama/styles/custom_game/cs2fixes/entwatch_settings.css new file mode 100644 index 00000000..972eec0b --- /dev/null +++ b/assets_source/panorama/styles/custom_game/cs2fixes/entwatch_settings.css @@ -0,0 +1,310 @@ +@import url("file://{resources}/styles/custom_game/cs2fixes/entwatch_common.css"); + +.Root { + width: 100%; + height: 100%; +} + +.SettingsPanel { + min-width: 720px; + width:38%; + min-height: 440px; + height: width-percentage(62%); + horizontal-align: center; + vertical-align: center; + flow-children: right; + padding: 24px; + background-color: #000000F0; + background-img-opacity: 0.015; + background-size: 360px 360px; + background-image: url("s2r://panorama/images/backgrounds/bluedots_large_png.vtex"); + background-blur: gaussian(3); + border: 2px solid rgb(206, 206, 206); + border-radius: 4px; + font-family: Stratum2; + color: #f2f2f2; + opacity: 1; +} +.SettingsPanel.Hidden { + visibility: collapse; +} + +.SettingsColumn { + width: 330px; + height: 100%; + flow-children: down; + margin-right: 28px; +} + +.ColorColumn { + width: fill-parent-flow(1.0); + height: 100%; + flow-children: down; +} + +.TogglePanel { + width:349px; + flow-children: down; + margin-right: 16px; +} +.SettingRow { + width: fit-children; + height: 48px; + flow-children: right; + margin-bottom: 8px; + horizontal-align: right; +} + +.SettingName { + width: fit-children; + vertical-align: center; + text-align: right; + font-size: 22px; + margin-right: 18px; +} + +.ToggleButton { + width: 94px; + height: 42px; + vertical-align: center; + padding: 5px; + border: 3px solid #d5d9dd; + border-radius: 11px; + background-color: #080c10; + transition-property: background-color, border-color; + transition-duration: 0.22s, 0.12s; +} + +.ToggleButton:hover { + border-color: white; + sound: "UIPanorama.mainmenu_rollover"; +} + +.ToggleKnob { + width: 26px; + height: 26px; + vertical-align: center; + border-radius: 50%; + background-color: #858b91; + horizontal-align: left; + transition-property: position, background-color; + transition-duration: 0.22s; +} + +.ToggleButton.Selected, +.ToggleButton.On { + background-color: #3076a8; +} + +.ToggleButton.Selected .ToggleKnob, +.ToggleButton.On .ToggleKnob { + horizontal-align: right; + background-color: white; +} + +.PositionControls { + width: 100%; + flow-children: down; + margin-top: 6px; + horizontal-align: right; +} + +.SectionTitle { + width: 100%; + text-align: center; + font-size: 21px; + color: #f2f2f2; + margin-bottom: 7px; +} + +.AdjustmentRow { + width: fit-children; + height: 58px; + horizontal-align:center; + flow-children: right; + margin-bottom: 8px; +} +.AdjustmentRow:last-child { + margin-right: 0px; +} + +.AdjustmentButton { + width: 55px; + height: 55px; + margin-right: 8px; + border: 3px solid #d5d9dd; + background-color: #080c10; + transition-property: background-color, border-color; + transition-duration: 0.1s; +} +#PositionXPlus10 { + margin-right: 0px; +} +#PositionYPlus10 { + margin-right: 0px; +} + +.AdjustmentButton:hover { + background-color: #29343e; + border-color: white; + sound: "UIPanorama.mainmenu_rollover"; +} + +.AdjustmentButton:active { + background-color: #3a4b59; +} + +.AdjustmentButton Label { + horizontal-align: center; + vertical-align: center; + text-align: center; + font-size: 20px; + color: #f2f2f2; +} + +.HudPosLabel { + height:55px; + width: 42px; + margin-right: 8px; + flow-children: down; +} +.AxisLabelText { + vertical-align: center; + horizontal-align:center; + text-align: center; + font-size: 20px; + color:white; +} +.AxisLabel { + vertical-align: top; + horizontal-align:center; + margin-top: -8px; + text-align: center; + font-size: 30px; + color: white; +} + +.HudSizeControls { + width: 100%; + flow-children: down; + margin-top: 1px; +} + +.SizeRow { + horizontal-align: center; + height: 58px; + flow-children: right; +} + +.SizeButton { + margin-right: 0px; +} + +.SizeValue { + width: 70px; + vertical-align: center; + text-align: center; + font-size: 20px; + color: #f2f2f2; +} + +.ColorHeader { + width: 100%; + height: 31px; +} + +.ColorTitle { + horizontal-align: center; + vertical-align: center; + margin-bottom: 0px; +} + +.CloseButton { + ignore-parent-flow: true; + width: 29px; + height: 29px; + horizontal-align: right; + vertical-align: top; + margin-top: -16px; + margin-right: -16px; + border: 1px solid #9099a1; + border-radius: 4px; + background-color: transparent; + transition-property: background-color, border-color; + transition-duration: 0.1s; +} + +.CloseButton:hover { + border-color: white; + background-color: #888888; + sound: "UIPanorama.mainmenu_rollover"; +} + +.CloseButton Label { + horizontal-align: center; + vertical-align: center; + text-align: center; + font-size: 19px; + color: #f2f2f2; +} + +.ColorList { + width: 100%; + height: 100%; + flow-children:down; + overflow: squish scroll; + horizontal-align: center; + border: 3px solid #d5d9dd; +} + +.ColorPanel { + border-width: 2px; + border-style: solid; + border-color: #00000000; + border-radius: 3px; + flow-children: right; + height: 30px; + width:90%; + font-size: 24px; + background-color: transparent; + margin-top: 8px; + horizontal-align: center; + transition-property: border-color; + transition-duration: 0.2s; +} +.ColorPanel:hover { + border-color: #a2a2a2; + sound: "UIPanorama.mainmenu_rollover"; +} +.ColorPanel.Selected { + border-color: #fff; + border-width: 3px; +} +.ColorPanel .ColorSquare { + margin-right: 8px; +} +.ColorPanel .ColorLabel { + margin-right: 8px; +} +.ColorPanel .ColorSquareEnd { + margin-right: 0px; +} + +.ColorSquare { + height: 100%; + width: height-percentage( 100% ); + background-color: #ffffff; +} +.ColorSquareEnd { + height: 100%; + width: fill-parent-flow(1.0); + background-color: #ffffff; +} + +.ColorLabel { + text-align: center; + vertical-align: center; + width: fill-parent-flow(0.6); + text-shadow: 2px 2px 8px 3.0 #333333b0; + color:#ffffff; +} diff --git a/src/entwatch.cpp b/src/entwatch.cpp index 916b3710..1a40ab6e 100644 --- a/src/entwatch.cpp +++ b/src/entwatch.cpp @@ -26,7 +26,7 @@ #include "entity/ccsplayercontroller.h" #include "entity/ccsplayerpawn.h" #include "entity/cmathcounter.h" -#include "entity/cpointworldtext.h" +#include "entity/customhudlayout.h" #include "entity/services.h" #include "eventlistener.h" #include "leader.h" @@ -57,6 +57,29 @@ CConVar g_cvarUseEntwatchClantag("entwatch_clantag", FCVAR_NONE, "Whether 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); +// Colour names to show on the !hud menu, change the hex in entwatch_common.css +std::string g_HudColors[EW_MAX_HUDCOLORS] = { + "white", + "gray", + "red", + "coral", + "orange", + "yellow", + "olive", + "lime", + "emerald", + "mint", + "cyan", + "sky", + "blue", + "navy", + "purple", + "lavender", + "magenta", + "rose", + "pink", + "brown"}; + void ItemGlowDistanceChanged(CConVar* ref, CSplitScreenSlot nSlot, const int* pNewValue, const int* pOldValue) { if (!g_pEWHandler || !g_pEWHandler->IsConfigLoaded() || g_pEWHandler->vecItems.size() < 1) @@ -467,6 +490,7 @@ void EWItem::SetDefaultValues() /* no default hammerid */ V_strcpy(sChatColor, "\x01"); colorGlow = Color(255, 255, 255, 255); + iHudColor = 0; bShowPickup = true; bShowHud = true; transfer = EWCfg_Auto; @@ -481,77 +505,92 @@ void EWItem::ParseColor(std::string value) { V_strcpy(sChatColor, "\x01"); colorGlow = Color(255, 255, 255, 255); + iHudColor = 1; } else if (value == "darkred") { V_strcpy(sChatColor, "\x02"); colorGlow = Color(220, 0, 0, 255); + iHudColor = 2; } else if (value == "team") { V_strcpy(sChatColor, "\x03"); colorGlow = Color(184, 130, 242, 255); + iHudColor = 3; } else if (value == "green") { V_strcpy(sChatColor, "\x04"); colorGlow = Color(30, 255, 30, 255); + iHudColor = 4; } else if (value == "lightgreen") { V_strcpy(sChatColor, "\x05"); colorGlow = Color(178, 255, 145, 255); + iHudColor = 5; } else if (value == "olive") { V_strcpy(sChatColor, "\x06"); colorGlow = Color(184, 220, 63, 255); + iHudColor = 6; } else if (value == "red") { V_strcpy(sChatColor, "\x07"); colorGlow = Color(255, 65, 65, 255); + iHudColor = 7; } else if (value == "gray" || value == "grey") { V_strcpy(sChatColor, "\x08"); colorGlow = Color(175, 180, 180, 255); + iHudColor = 8; } else if (value == "yellow") { V_strcpy(sChatColor, "\x09"); colorGlow = Color(250, 250, 25, 255); + iHudColor = 9; } else if (value == "silver") { V_strcpy(sChatColor, "\x0A"); colorGlow = Color(165, 180, 210, 255); + iHudColor = 10; } else if (value == "blue") { V_strcpy(sChatColor, "\x0B"); colorGlow = Color(114, 188, 255, 255); + iHudColor = 11; } else if (value == "darkblue") { V_strcpy(sChatColor, "\x0C"); colorGlow = Color(45, 75, 255, 255); + iHudColor = 12; } // \x0D is the same as \x0A else if (value == "purple" || value == "pink") { V_strcpy(sChatColor, "\x0E"); colorGlow = Color(210, 43, 229, 255); + iHudColor = 14; } else if (value == "red2") { V_strcpy(sChatColor, "\x0F"); colorGlow = Color(230, 120, 120, 255); + iHudColor = 15; } else if (value == "orange" || value == "gold") { V_strcpy(sChatColor, "\x10"); colorGlow = Color(235, 145, 46, 255); + iHudColor = 16; } } @@ -563,6 +602,7 @@ EWItem::EWItem(std::shared_ptr pItem) szHammerid = pItem->szHammerid; V_strcpy(sChatColor, pItem->sChatColor); colorGlow = pItem->colorGlow; + iHudColor = pItem->iHudColor; bShowPickup = pItem->bShowPickup; bShowHud = pItem->bShowHud; transfer = pItem->transfer; @@ -1181,6 +1221,33 @@ void CEWHandler::ClearItems() vecItems.clear(); } +void CEWHandler::ClearHud() +{ + if (!hHud.Get()) + return; + + std::string stateId; + std::string itemId; + std::string nameId; + std::string playerId; + + for (int i = 0; i < EW_HUD_MAXITEMS; i++) + { + const std::string index = std::to_string(i); + + stateId = EW_HUD_STATE_ID + index; + itemId = "Item-" + index; + nameId = EW_HUD_NAME_ID + index; + playerId = EW_HUD_PLAYER_ID + index; + + hHud->SetDialogVariableString(stateId, "State", ""); + hHud->SetHasClass(stateId, "Hidden", true); + hHud->SetHasClass(itemId, "Hidden", true); + hHud->SetDialogVariableString(nameId, "Name", ""); + hHud->SetDialogVariableString(playerId, "Player", ""); + } +} + /* * Finds the index of an item instance with a given entity index * Returns index into vecItems or -1 if not found @@ -1598,7 +1665,7 @@ void CEWHandler::PlayerPickup(CCSPlayerPawn* pPawn, int iItemInstance) if (m_pHudTimer.expired()) m_pHudTimer = CTimer::Create(EW_HUD_TICKRATE, TIMERFLAG_MAP | TIMERFLAG_ROUND, [] { - return EW_UpdateHud(); + return g_pEWHandler->UpdateHud(); }); } @@ -1861,20 +1928,163 @@ KHook::Return CEWHandler::Hook_Use(CBaseEntity* pThis, InputData_t* pInput return {KHook::Action::Ignore}; } +void CEWHandler::ShowHudMenu(CCSPlayerController* pController, ZEPlayer* zpPlayer) +{ + if (!hHudSettings.Get()) + { + hHudSettings = CCSCustomHudLayout::Create("cs2fixes/entwatch_settings"); + for (int i = 0; i < EW_MAX_HUDCOLORS; i++) + { + std::string labelId = "ColorLabel-" + std::to_string(i); + std::string strPrettyName = g_HudColors[i]; + strPrettyName[0] = toupper(strPrettyName[0]); + hHudSettings->SetDialogVariableString(labelId, "ColorName", strPrettyName); + } + + hHudSettings->SetClickCallback([](CCSPlayerController* pController, CCSCustomHudLayout* pHud, std::string sButtonId) { + if (sButtonId == "CloseButton") + { + pHud->SetHasClass("SettingsPanel", "Hidden", true, pController); + pHud->SetInputCaptureEnabled(false, pController); + } + else if (sButtonId == "ToggleEntWatchHud") + { + ZEPlayer* zpPlayer = g_playerManager->GetPlayer(pController->GetPlayerSlot()); + if (zpPlayer) + zpPlayer->SetEntwatchHudEnabled(!zpPlayer->GetEntwatchHudEnabled()); + } + else if (sButtonId == "TogglePlayerNames") + { + ZEPlayer* zpPlayer = g_playerManager->GetPlayer(pController->GetPlayerSlot()); + if (zpPlayer) + zpPlayer->SetEntwatchPlayerNames(!zpPlayer->GetEntwatchPlayerNames()); + } + else if (sButtonId == "HudSizeMinus") + { + ZEPlayer* zpPlayer = g_playerManager->GetPlayer(pController->GetPlayerSlot()); + if (zpPlayer) + { + int size = zpPlayer->GetEntwatchHudSize(); + size -= 5; + if (size < EW_HUDSIZE_MIN) + size = EW_HUDSIZE_MIN; + if (size != zpPlayer->GetEntwatchHudSize()) + zpPlayer->SetEntwatchHudSize(size); + } + } + else if (sButtonId == "HudSizePlus") + { + ZEPlayer* zpPlayer = g_playerManager->GetPlayer(pController->GetPlayerSlot()); + if (zpPlayer) + { + int size = zpPlayer->GetEntwatchHudSize(); + size += 5; + if (size > EW_HUDSIZE_MAX) + size = EW_HUDSIZE_MAX; + if (size != zpPlayer->GetEntwatchHudSize()) + zpPlayer->SetEntwatchHudSize(size); + } + } + else if (sButtonId.starts_with("PositionX")) + { + ZEPlayer* zpPlayer = g_playerManager->GetPlayer(pController->GetPlayerSlot()); + if (zpPlayer) + { + int x = zpPlayer->GetEntwatchHudX(); + if (sButtonId == "PositionXMinus10") + x -= 10; + else if (sButtonId == "PositionXMinus1") + x -= 1; + else if (sButtonId == "PositionXPlus1") + x += 1; + else if (sButtonId == "PositionXPlus10") + x += 10; + + if (x < EW_HUDPOS_MIN) + x = EW_HUDPOS_MIN; + else if (x > EW_HUDPOS_MAX) + x = EW_HUDPOS_MAX; + + if (x != zpPlayer->GetEntwatchHudX()) + zpPlayer->SetEntwatchHudPos(x, zpPlayer->GetEntwatchHudY()); + } + } + else if (sButtonId.starts_with("PositionY")) + { + ZEPlayer* zpPlayer = g_playerManager->GetPlayer(pController->GetPlayerSlot()); + if (zpPlayer) + { + int y = zpPlayer->GetEntwatchHudY(); + if (sButtonId == "PositionYMinus10") + y -= 10; + else if (sButtonId == "PositionYMinus1") + y -= 1; + else if (sButtonId == "PositionYPlus1") + y += 1; + else if (sButtonId == "PositionYPlus10") + y += 10; + + if (y < EW_HUDPOS_MIN) + y = EW_HUDPOS_MIN; + else if (y > EW_HUDPOS_MAX) + y = EW_HUDPOS_MAX; + + if (y != zpPlayer->GetEntwatchHudY()) + zpPlayer->SetEntwatchHudPos(zpPlayer->GetEntwatchHudX(), y); + } + } + else if (sButtonId.starts_with("ColorPanel-")) + { + std::string strColorIndex = sButtonId.substr(11); + int i = V_StringToInt32(strColorIndex.c_str(), -1); + if (i >= 0 && i < EW_MAX_HUDCOLORS) + { + ZEPlayer* zpPlayer = g_playerManager->GetPlayer(pController->GetPlayerSlot()); + if (zpPlayer) + zpPlayer->SetEntwatchHudColor(i); + } + } + }); + } + + hHudSettings->SetHasClass("ToggleEntWatchHud", "Selected", zpPlayer->GetEntwatchHudEnabled(), pController); + hHudSettings->SetHasClass("TogglePlayerNames", "Selected", zpPlayer->GetEntwatchPlayerNames(), pController); + + std::string text = std::to_string(zpPlayer->GetEntwatchHudSize()); + hHudSettings->SetDialogVariableString("HudSizeValue", "Scale", text, pController); + + text = std::to_string(zpPlayer->GetEntwatchHudX()); + hHudSettings->SetDialogVariableString("HudPosXValue", "HudPosX", text, pController); + + text = std::to_string(zpPlayer->GetEntwatchHudY()); + hHudSettings->SetDialogVariableString("HudPosYValue", "HudPosY", text, pController); + + text = "ColorPanel-" + std::to_string(zpPlayer->GetEntwatchHudColor()); + hHudSettings->SetHasClass(text, "Selected", true, pController); + + hHudSettings->SetHasClass("SettingsPanel", "Hidden", false, pController); + hHudSettings->SetInputCaptureEnabled(true, pController); +} + // Update cd and uses of all held items -float EW_UpdateHud() +float CEWHandler::UpdateHud() { if (!GetGlobals()) return EW_HUD_TICKRATE; - std::string sHudText = ""; - std::string sHudTextNoPlayerNames = ""; - static bool bWasEmptyPreviously = false; + if (g_cvarEnableEntwatchHud.Get() && !hHud.Get()) + { + hHud = CCSCustomHudLayout::Create("cs2fixes/entwatch_hud"); + for (int i = 0; i < MAX_PLAYERS; i++) + bClientHudInitialized[i] = false; + } + + int iItemsOnHud = 0; bool bFirst = true; - for (int i = 0; i < (g_pEWHandler->vecItems).size(); i++) + for (int i = 0; i < (vecItems).size(); i++) { - std::shared_ptr pItem = g_pEWHandler->vecItems[i]; + std::shared_ptr pItem = vecItems[i]; if (!pItem) continue; @@ -1897,41 +2107,60 @@ float EW_UpdateHud() pOwner->SetClanTag(pItem->sClantag); } - if (!g_cvarEnableEntwatchHud.Get()) + if (!g_cvarEnableEntwatchHud.Get() || iItemsOnHud >= EW_HUD_MAXITEMS) continue; - // std::format not supported in clang16 by default (steamrt3) - if (!bFirst) + const std::string sIndex = std::to_string(iItemsOnHud); + std::string panelid = EW_HUD_STATE_ID + sIndex; + hHud->SetDialogVariableString(panelid, "State", sItemText); + hHud->SetHasClass(panelid, "Hidden", false); + + if (pItem->iHudColor != iItemColors[iItemsOnHud]) { - sHudText.append("\n"); - sHudTextNoPlayerNames.append("\n"); + std::string colorclass = EW_HUDCOLOR_SHADOW + std::to_string(iItemColors[iItemsOnHud]); + hHud->SetHasClass(panelid, colorclass, false); + + colorclass = EW_HUDCOLOR_SHADOW + std::to_string(pItem->iHudColor); + hHud->SetHasClass(panelid, colorclass, true); + + iItemColors[iItemsOnHud] = pItem->iHudColor; } - else - bFirst = false; - sHudText.append("["); - sHudText.append(sItemText); - sHudText.append("]"); - sHudText.append(pItem->szShortName); - sHudText.append(": "); - sHudText.append(pOwner->GetPlayerName()); + panelid = "Item-" + sIndex; + hHud->SetHasClass(panelid, "Hidden", false); - // sHudTextNoPlayerNames.append(std::format("\n[{}]{}", sItemText, pItem->szShortName)); - sHudTextNoPlayerNames.append("["); - sHudTextNoPlayerNames.append(sItemText); - sHudTextNoPlayerNames.append("]"); - sHudTextNoPlayerNames.append(pItem->szShortName); - } + panelid = EW_HUD_NAME_ID + sIndex; + hHud->SetDialogVariableString(panelid, "Name", pItem->szShortName); - if (sHudText != "") - { - bWasEmptyPreviously = false; + panelid = EW_HUD_PLAYER_ID + sIndex; + hHud->SetDialogVariableString(panelid, "Player", pOwner->GetPlayerName()); + + iItemsOnHud++; } - else + + if (iItemsOnHud == 0 && iItemsOnHudLastTick == 0) + return EW_HUD_TICKRATE; + + // Clear any that weren't overridden + if (iItemsOnHudLastTick > iItemsOnHud) { - if (bWasEmptyPreviously) - return EW_HUD_TICKRATE; - bWasEmptyPreviously = true; + for (int i = iItemsOnHud; i < iItemsOnHudLastTick; i++) + { + const std::string sIndex = std::to_string(i); + + std::string panelid = "ItemState-" + sIndex; + hHud->SetDialogVariableString(panelid, "State", ""); + hHud->SetHasClass(panelid, "Hidden", true); + + panelid = "Item-" + sIndex; + hHud->SetHasClass(panelid, "Hidden", true); + + panelid = EW_HUD_NAME_ID + sIndex; + hHud->SetDialogVariableString(panelid, "Name", ""); + + panelid = EW_HUD_PLAYER_ID + sIndex; + hHud->SetDialogVariableString(panelid, "Player", ""); + } } for (int i = 0; i < GetGlobals()->maxClients; i++) @@ -1943,23 +2172,44 @@ float EW_UpdateHud() if (!pPawn) continue; ZEPlayer* zpPlayer = g_playerManager->GetPlayer(CPlayerSlot(i)); - if (!zpPlayer) + if (!zpPlayer || zpPlayer->IsFakeClient()) continue; - EWHudMode mode = (EWHudMode)(zpPlayer->GetEntwatchHudMode()); + // Clients joining an existing HUD still need their saved preferences applied. + if (!bClientHudInitialized[i]) + { + // Initialising classes so don't need to remove any + // Default is HUD disabled, player names enabled + hHud->SetHasClass("HudTextPanel", "Hidden", !zpPlayer->GetEntwatchHudEnabled(), pController); - CPointWorldText* pText = zpPlayer->GetEntwatchHud(); - if (!pText) - continue; + std::string text = EW_HUDPOS_X_CLASS + std::to_string(zpPlayer->GetEntwatchHudX()); + hHud->SetHasClass("HudTextPanel", text, true, pController); - if (mode == EWHudMode::Hud_On) - pText->AcceptInput("SetMessage", sHudText.c_str()); - else if (mode == EWHudMode::Hud_ItemOnly) - pText->AcceptInput("SetMessage", sHudTextNoPlayerNames.c_str()); - else - pText->AcceptInput("SetMessage", ""); + text = EW_HUDPOS_Y_CLASS + std::to_string(zpPlayer->GetEntwatchHudY()); + hHud->SetHasClass("HudTextPanel", text, true, pController); + + text = EW_HUDSIZE_CLASS + std::to_string(zpPlayer->GetEntwatchHudSize()); + hHud->SetHasClass("HudTextPanel", text, true, pController); + + text = EW_HUDCOLOR_CLASS + std::to_string(zpPlayer->GetEntwatchHudColor()); + hHud->SetHasClass("ItemNamesColumn", text, true, pController); + } + + // Initialise player names too, then update changes while the HUD is enabled. + if (!bClientHudInitialized[i] || (zpPlayer->GetEntwatchHudEnabled() && bPlayerNames[i] != zpPlayer->GetEntwatchPlayerNames())) + { + for (int j = 0; j < EW_HUD_MAXITEMS; j++) + { + const std::string sIndex = std::to_string(j); + const std::string sPanelId = "ItemPlayer-" + sIndex; + hHud->SetHasClass(sPanelId, "Hidden", !zpPlayer->GetEntwatchPlayerNames(), pController); + } + bPlayerNames[i] = zpPlayer->GetEntwatchPlayerNames(); + } + bClientHudInitialized[i] = true; } + iItemsOnHudLastTick = iItemsOnHud; return EW_HUD_TICKRATE; } @@ -1967,6 +2217,13 @@ void EW_OnLevelInit(const char* sMapName) { g_pEWHandler->UnLoadConfig(); g_pEWHandler->LoadMapConfig(sMapName); + g_pEWHandler->iItemsOnHudLastTick = 0; + + for (int i = 0; i < EW_HUD_MAXITEMS; i++) + g_pEWHandler->iItemColors[i] = 0; + + for (int i = 0; i < MAX_PLAYERS; i++) + g_pEWHandler->bPlayerNames[i] = true; } void EW_RoundPreStart() @@ -1976,6 +2233,7 @@ void EW_RoundPreStart() g_pEWHandler->ResetAllClantags(); g_pEWHandler->ClearItems(); + g_pEWHandler->ClearHud(); } void EW_OnEntitySpawned(CEntityInstance* pEntity) @@ -2192,18 +2450,13 @@ void EW_PlayerDeathPre(CCSPlayerController* pController) void EW_PlayerDisconnect(int slot) { - ZEPlayer* pPlayer = g_playerManager->GetPlayer(CPlayerSlot(slot)); - if (pPlayer) - { - CPointWorldText* pText = pPlayer->GetEntwatchHud(); - if (pText) - pText->Remove(); - } - auto i = g_pEWHandler->mapTransfers.find(slot); if (i != g_pEWHandler->mapTransfers.end()) g_pEWHandler->mapTransfers.erase(slot); + g_pEWHandler->bPlayerNames[slot] = true; + g_pEWHandler->bClientHudInitialized[slot] = false; + CCSPlayerController* pController = CCSPlayerController::FromSlot(slot); if (!pController) return; @@ -2579,22 +2832,7 @@ CON_COMMAND_CHAT(hud, "- Toggle EntWatch HUD") return; } - EWHudMode mode = (EWHudMode)(zpPlayer->GetEntwatchHudMode()); - if (mode == EWHudMode::Hud_None) - mode = EWHudMode::Hud_On; - else if (mode == EWHudMode::Hud_On) - mode = EWHudMode::Hud_ItemOnly; - else - mode = EWHudMode::Hud_None; - - zpPlayer->SetEntwatchHudMode((int)mode); - - if (mode == EWHudMode::Hud_None) - ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "EntWatch HUD\x07 disabled."); - else if (mode == EWHudMode::Hud_On) - ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "EntWatch HUD\x04 enabled."); - else - ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "EntWatch HUD\x04 enabled\x10 (Item names only)."); + g_pEWHandler->ShowHudMenu(player, zpPlayer); } CON_COMMAND_CHAT(hudpos, " - Sets the position of the EntWatch hud.") @@ -2624,18 +2862,23 @@ CON_COMMAND_CHAT(hudpos, " - Sets the position of the EntWatch hud.") if (args.ArgC() < 3) { ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Usage: !hudpos "); - ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Current hudpos: %.1fx %.1fy", zpPlayer->GetEntwatchHudX(), zpPlayer->GetEntwatchHudY()); + ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Current hudpos: %dx %dy", zpPlayer->GetEntwatchHudX(), zpPlayer->GetEntwatchHudY()); return; } - float x = std::atof(args[1]); - float y = std::atof(args[2]); + int x = std::atoi(args[1]); + int y = std::atoi(args[2]); + if (x < 0 || x > 99 || y < 0 || y > 99) + { + ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "X and Y values must be between 0 and 99!"); + return; + } zpPlayer->SetEntwatchHudPos(x, y); - ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Set hudpos to: %.1fx %.1fy", x, y); + ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Set hudpos to: %dx %dy", x, y); } -CON_COMMAND_CHAT(hudcolor, " [a] - Set color (and transparency) of the Entwatch hud") +CON_COMMAND_CHAT(hudcolor, "[color] - Set color of the Entwatch hud") { if (!g_cvarEnableEntWatch.Get()) return; @@ -2659,32 +2902,27 @@ CON_COMMAND_CHAT(hudcolor, " [a] - Set color (and transparency) of th return; } - Color clrCur = zpPlayer->GetEntwatchHudColor(); - if (args.ArgC() < 4) + if (args.ArgC() < 2) { - ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Usage: !hudcolor [Optional: alpha]"); - ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Current hudcolor:\x07 %d\x04 %d\x0C %d\x01 %d", clrCur.r(), clrCur.g(), clrCur.b(), clrCur.a()); + ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Usage: !hudcolor [color]"); + ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Current hudcolor:\x04 %s", g_HudColors[zpPlayer->GetEntwatchHudColor()].c_str()); return; } - int r = std::atoi(args[1]); - int g = std::atoi(args[2]); - int b = std::atoi(args[3]); - int a = clrCur.a(); - Color newColor; - if (args.ArgC() > 4) + std::string colour = args[1]; + colour = StringToLower(colour); + for (int i = 0; i < EW_MAX_HUDCOLORS; i++) { - a = std::atoi(args[4]); - newColor.SetColor(r, g, b, a); - ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Set hudcolor to:\x07 %d\x04 %d\x0C %d\x01 %d", newColor.r(), newColor.g(), newColor.b(), newColor.a()); - } - else - { - newColor.SetColor(r, g, b, a); - ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Set hudcolor to:\x07 %d\x04 %d\x0C %d", newColor.r(), newColor.g(), newColor.b()); + if (colour == g_HudColors[i]) + { + zpPlayer->SetEntwatchHudColor(i); + ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Hud color set to:\x04 %s", g_HudColors[i].c_str()); + return; + } } - zpPlayer->SetEntwatchHudColor(newColor); + ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Invalid hud color entered! Color names are on the \x04!hud \x01menu."); + ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Usage: !hudcolor "); } CON_COMMAND_CHAT(hudsize, " - Set font size of the EntWatch hud") @@ -2714,17 +2952,18 @@ CON_COMMAND_CHAT(hudsize, " - Set font size of the EntWatch hud") if (args.ArgC() < 2) { ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Usage: !hudsize "); - float flSize = zpPlayer->GetEntwatchHudSize(); - ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Current hud size:\x04 %.2f", flSize); + ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Current hud size:\x04 %d%%", zpPlayer->GetEntwatchHudSize()); return; } - float size = std::atof(args[1]); - if (size < 20.0f) // size 20 with 0.005 units per pixel is small - size = 20.0f; - else if (size > 255.0f) // game has a max of 255 - size = 255.0f; + int size = std::atoi(args[1]); + if (size < EW_HUDSIZE_MIN || size > EW_HUDSIZE_MAX || size % 5 != 0) + { + ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Hud size must be a multiple of 5 between \x04%d - %d", EW_HUDSIZE_MIN, EW_HUDSIZE_MAX); + ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Usage: !hudsize "); + return; + } - ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Hud font size set to:\x04 %.2f", size); + ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Hud size set to:\x04 %d%%", size); zpPlayer->SetEntwatchHudSize(size); } diff --git a/src/entwatch.h b/src/entwatch.h index 1526bb2f..b84c0fb7 100644 --- a/src/entwatch.h +++ b/src/entwatch.h @@ -30,25 +30,45 @@ using ordered_json = nlohmann::ordered_json; class CCSPlayerController; class CCSPlayerPawn; +class CCSCustomHudLayout; +class ZEPlayer; extern CConVar g_cvarEnableEntWatch; extern CConVar g_cvarEnableEntwatchHud; #define EW_PREFIX " \4[EntWatch]\1 " -#define EW_PREF_HUD_MODE "entwatch_hud" -#define EW_PREF_HUDPOS_X "entwatch_hudpos_x" -#define EW_PREF_HUDPOS_Y "entwatch_hudpos_y" -#define EW_PREF_HUDCOLOR "entwatch_hudcolor" -#define EW_PREF_HUDSIZE "entwatch_hudfontsize" - -#define EW_HUDPOS_X_DEFAULT -7.5f -#define EW_HUDPOS_Y_DEFAULT -2.0f - -#define EW_HUDSIZE_DEFAULT 60.0f +#define EW_PREF_HUD_MODE "entwatch_pano_hud" +#define EW_PREF_HUD_PLAYERNAMES "entwatch_pano_hud_playernames" +#define EW_PREF_HUDPOS_X "entwatch_pano_hudpos_x" +#define EW_PREF_HUDPOS_Y "entwatch_pano_hudpos_y" +#define EW_PREF_HUDCOLOR "entwatch_pano_hudcolor" +#define EW_PREF_HUDSIZE "entwatch_pano_hudsize" + +#define EW_HUDPOS_X_CLASS "HudPosX" +#define EW_HUDPOS_Y_CLASS "HudPosY" +#define EW_HUDPOS_X_DEFAULT 6 +#define EW_HUDPOS_Y_DEFAULT 35 +#define EW_HUDPOS_MIN 0 +#define EW_HUDPOS_MAX 99 + +#define EW_HUDSIZE_CLASS "Scale-" +#define EW_HUDSIZE_DEFAULT 100 +#define EW_HUDSIZE_MIN 50 +#define EW_HUDSIZE_MAX 150 + +#define EW_MAX_HUDCOLORS 20 +#define EW_HUDCOLOR_CLASS "HudColour-" +#define EW_HUDCOLOR_DEFAULT 0 #define EW_HUD_TICKRATE 0.5f +#define EW_HUD_MAXITEMS 64 // Number of items defined in entwatch_hud.xml +#define EW_HUD_STATE_ID "ItemState-" +#define EW_HUD_NAME_ID "ItemName-" +#define EW_HUD_PLAYER_ID "ItemPlayer-" +#define EW_HUDCOLOR_SHADOW "HudColourShadow-" + enum EWHandlerType { Type_None, @@ -78,13 +98,6 @@ enum EWDropReason Deleted }; -enum EWHudMode -{ - Hud_None, - Hud_On, - Hud_ItemOnly, -}; - enum EWAutoConfigOption { EWCfg_Auto = -1, @@ -142,6 +155,7 @@ struct EWItem std::string szHammerid; /* Hammerid of the weapon */ char sChatColor[2]; Color colorGlow; + int iHudColor; /* Color for hud css class */ bool bShowPickup; /* Whether to show pickup/drop messages in chat */ bool bShowHud; /* Whether to show this item on hud/scoreboard */ EWAutoConfigOption transfer; /* Can this item be transferred */ @@ -253,6 +267,7 @@ class CEWHandler void PrintLoadedConfig(CCSPlayerController* pController); void ClearItems(); + void ClearHud(); int FindItemInstanceByWeapon(int iWeaponEnt); int FindItemInstanceByOwner(int iOwnerSlot, bool bOnlyTransferrable, int iStartItem); @@ -274,6 +289,9 @@ class CEWHandler void RemoveUseEntity(CBaseEntity* pEnt); KHook::Return Hook_Use(CBaseEntity* pThis, InputData_t* pInput); + void ShowHudMenu(CCSPlayerController* pController, ZEPlayer* zpPlayer); + float UpdateHud(); + std::map> mapItemConfig; /* items defined in the config */ std::vector> vecItems; /* all items found spawned */ @@ -286,6 +304,13 @@ class CEWHandler std::map> mapTransfers; // Any etransfers that target multiple items std::vector> vecActiveTransfers; // Active transfers where only the receiver can pickup the weapon + CHandle hHud; + CHandle hHudSettings; + int iItemsOnHudLastTick = 0; + int iItemColors[EW_HUD_MAXITEMS] = {}; + bool bPlayerNames[MAX_PLAYERS] = {true}; + bool bClientHudInitialized[MAX_PLAYERS] = {}; + KHook::Virtual m_hBaseButtonUse; KHook::Virtual m_hPhysBoxUse; KHook::Virtual m_hRotButtonUse; @@ -317,4 +342,3 @@ void EW_PlayerDeathPre(CCSPlayerController* pController); void EW_PlayerDisconnect(int slot); void EW_FireOutput(const CEntityIOOutput* pThis, CEntityInstance* pActivator, CEntityInstance* pCaller, float flDelay); int GetTemplateSuffixNumber(const char* szName); -float EW_UpdateHud(); \ No newline at end of file diff --git a/src/events.cpp b/src/events.cpp index e64cec2c..1828be37 100644 --- a/src/events.cpp +++ b/src/events.cpp @@ -93,6 +93,27 @@ GAME_EVENT_F(player_team) pEvent->SetBool("silent", true); } +GAME_EVENT_F(player_connect_full) +{ + CCSPlayerController* pController = (CCSPlayerController*)pEvent->GetPlayerController("userid"); + if (!pController) + return; + + CHandle hController = pController->GetHandle(); + + // custom_hud_layout entities clear the new controller's slot during this event. + CTimer::Create(0.0f, TIMERFLAG_MAP, [hController]() { + CCSPlayerController* pController = hController.Get(); + if (!pController) + return -1.0f; + + if (g_pEWHandler) + g_pEWHandler->bClientHudInitialized[pController->GetPlayerSlot()] = false; + + return -1.0f; + }); +} + CConVar g_cvarNoblock("cs2f_noblock_enable", FCVAR_NONE, "Whether to use player noblock, which sets debris collision on every player", false); CConVar g_cvarFreeArmor("cs2f_free_armor", FCVAR_NONE, "Whether kevlar (1+) and/or helmet (2) are given automatically", 0, true, 0, true, 2); diff --git a/src/playermanager.cpp b/src/playermanager.cpp index 0b4dfb63..04d8f53b 100644 --- a/src/playermanager.cpp +++ b/src/playermanager.cpp @@ -26,6 +26,7 @@ #include "engine2/ivengineserver2.h" #include "engine2/serversideclient.h" #include "entity/ccsplayercontroller.h" +#include "entity/customhudlayout.h" #include "entwatch.h" #include "leader.h" #include "map_votes.h" @@ -100,16 +101,6 @@ ZEPlayer* ZEPlayerHandle::Get() const void ZEPlayer::OnSpawn() { SetSpeedMod(1.f); - - ZEPlayerHandle handle = GetHandle(); - CTimer::Create(0.0f, TIMERFLAG_MAP | TIMERFLAG_ROUND, [handle] { - if (handle.Get()) - { - handle.Get()->CreatePointOrient(); - handle.Get()->CreateEntwatchHud(); - } - return -1.0f; - }); } void ZEPlayer::OnAuthenticated() @@ -623,39 +614,6 @@ void ZEPlayer::ReplicateConVar(const char* pszName, const char* pszValue) delete data; } -void ZEPlayer::CreatePointOrient() -{ - CPointOrient* pOrient = GetPointOrient(); - if (pOrient) - { - pOrient->Remove(); - pOrient = nullptr; - } - - CCSPlayerController* pController = CCSPlayerController::FromSlot(GetPlayerSlot()); - if (!pController) - return; - - CCSPlayerPawn* pPawn = pController->GetPlayerPawn(); - if (!pPawn) - return; - - Vector origin = pPawn->GetEyePosition(); - CEntityKeyValues* pKeyValues = g_pEntitySystem->CreateEntityKeyValues(nullptr, &origin); - - pKeyValues->SetInt("start_active", 1); - pKeyValues->SetString("goal_direction_type", "eEyesForward"); - - pOrient = g_pEntitySystem->SpawnEntityByClassname("point_orient", pKeyValues); - - if (!pOrient) - return; - - SetPointOrient(pOrient); - pOrient->AcceptInput("SetParent", "!activator", pPawn); - pOrient->AcceptInput("SetTarget", "!activator", pPawn); -} - void ZEPlayer::ToggleThirdPerson(float flDistance, bool bForce) { CCSPlayerController* pController = CCSPlayerController::FromSlot(GetPlayerSlot()); @@ -741,126 +699,124 @@ void ZEPlayer::ToggleThirdPerson(float flDistance, bool bForce) ClientPrint(pController, HUD_PRINTTALK, CHAT_PREFIX "You have enabled thirdperson."); } -void ZEPlayer::CreateEntwatchHud() +void ZEPlayer::SetEntwatchHudEnabled(bool bEnabled) { + m_bEntwatchHud = bEnabled; + g_pUserPreferencesSystem->SetPreferenceInt(m_slot.Get(), EW_PREF_HUD_MODE, m_bEntwatchHud ? 1 : 0); + CCSPlayerController* pController = CCSPlayerController::FromSlot(GetPlayerSlot()); - if (!pController) - return; + if (pController) + { + if (g_pEWHandler->hHud.Get()) + g_pEWHandler->hHud->SetHasClass("HudTextPanel", "Hidden", !m_bEntwatchHud, pController); - CCSPlayerPawn* pPawn = pController->GetPlayerPawn(); - if (!pPawn) - return; + if (g_pEWHandler->hHudSettings.Get()) + g_pEWHandler->hHudSettings->SetHasClass("ToggleEntWatchHud", "Selected", m_bEntwatchHud, pController); + } +} - CPointOrient* pOrient = GetPointOrient(); - if (!pOrient) - return; +void ZEPlayer::SetEntwatchPlayerNames(bool bEnabled) +{ + m_bEntwatchPlayerNames = bEnabled; + g_pUserPreferencesSystem->SetPreferenceInt(m_slot.Get(), EW_PREF_HUD_PLAYERNAMES, m_bEntwatchPlayerNames ? 1 : 0); - CPointWorldText* pText = GetEntwatchHud(); - if (pText) + CCSPlayerController* pController = CCSPlayerController::FromSlot(GetPlayerSlot()); + if (pController) { - pText->Remove(); - pText = nullptr; + if (g_pEWHandler->hHudSettings.Get()) + g_pEWHandler->hHudSettings->SetHasClass("TogglePlayerNames", "Selected", m_bEntwatchPlayerNames, pController); } +} - Color col; - CEntityKeyValues* pKeyValues = g_pEntitySystem->CreateEntityKeyValues(); - - int a = m_colorEntwatchHud.a(); - if (a == 255) // 254 allows it to be visible through some items - col.SetColor(m_colorEntwatchHud.r(), m_colorEntwatchHud.g(), m_colorEntwatchHud.b(), 254); - else - col.SetColor(m_colorEntwatchHud.r(), m_colorEntwatchHud.g(), m_colorEntwatchHud.b(), a); - - pKeyValues->SetBool("enabled", true); - pKeyValues->SetBool("fullbright", true); - pKeyValues->SetFloat("font_size", GetEntwatchHudSize()); - pKeyValues->SetColor("color", col); - pKeyValues->SetFloat("world_units_per_pixel", 0.005f); - pKeyValues->SetString("font_name", "Verdana Bold"); - pKeyValues->SetInt("justify_vertical", (int)PointWorldTextJustifyVertical_t::POINT_WORLD_TEXT_JUSTIFY_VERTICAL_TOP); - pKeyValues->SetString("message", ""); - - pText = g_pEntitySystem->SpawnEntityByClassname("point_worldtext", pKeyValues); - - if (!pText) - return; - - SetEntwatchHud(pText); - pText->SetParent(pOrient); - - Vector origin = pOrient->GetAbsOrigin(); - QAngle vmangles = pOrient->GetAbsRotation(); - - Vector forward; - Vector right; - Vector up; - AngleVectors(vmangles, &forward, &right, &up); - - origin += (forward * 7.0f); - - // -x = move left, +x = move right - origin += (right * GetEntwatchHudX()); +void ZEPlayer::SetEntwatchHudColor(int iColorIndex) +{ + const std::string sOldColor = std::to_string(m_iEntwatchColor); + const std::string sNewColor = std::to_string(iColorIndex); - // -y = move up, +y = move down - origin -= (up * GetEntwatchHudY()); + // Remove old + CCSPlayerController* pController = CCSPlayerController::FromSlot(GetPlayerSlot()); + if (pController) + { + std::string sOldText = "ColorPanel-" + sOldColor; + std::string sNewText = "ColorPanel-" + sNewColor; + if (g_pEWHandler->hHudSettings.Get()) + { + g_pEWHandler->hHudSettings->SetHasClass(sOldText, "Selected", false, pController); + g_pEWHandler->hHudSettings->SetHasClass(sNewText, "Selected", true, pController); + } - QAngle angles; - angles.x = 0.0f; - angles.y = AngleNormalize(vmangles.y - 90.0f); - angles.z = AngleNormalize(-vmangles.x + 90.0f); + if (g_pEWHandler->hHud.Get()) + { + sOldText = EW_HUDCOLOR_CLASS + sOldColor; + sNewText = EW_HUDCOLOR_CLASS + sNewColor; - pText->Teleport(&origin, &angles, nullptr); -} + g_pEWHandler->hHud->SetHasClass("ItemNamesColumn", sOldText, false, pController); + g_pEWHandler->hHud->SetHasClass("ItemNamesColumn", sNewText, true, pController); + } + } -int ZEPlayer::GetEntwatchHudMode() -{ - if (IsFakeClient()) - return 0; - return m_iEntwatchHudMode; + m_iEntwatchColor = iColorIndex; + g_pUserPreferencesSystem->SetPreferenceInt(m_slot.Get(), EW_PREF_HUDCOLOR, m_iEntwatchColor); } -void ZEPlayer::SetEntwatchHudMode(int iMode) +void ZEPlayer::SetEntwatchHudPos(int x, int y) { - m_iEntwatchHudMode = iMode; - g_pUserPreferencesSystem->SetPreferenceInt(m_slot.Get(), EW_PREF_HUD_MODE, m_iEntwatchHudMode); -} + const std::string sNewX = std::to_string(x); + const std::string sNewY = std::to_string(y); + std::string oldx = EW_HUDPOS_X_CLASS + std::to_string(m_iEntwatchHudX); + std::string oldy = EW_HUDPOS_Y_CLASS + std::to_string(m_iEntwatchHudY); + std::string newx = EW_HUDPOS_X_CLASS + sNewX; + std::string newy = EW_HUDPOS_Y_CLASS + sNewY; + // Remove old + CCSPlayerController* pController = CCSPlayerController::FromSlot(GetPlayerSlot()); + if (pController) + { + if (g_pEWHandler->hHud.Get()) + { + g_pEWHandler->hHud->SetHasClass("HudTextPanel", oldx, false, pController); + g_pEWHandler->hHud->SetHasClass("HudTextPanel", oldy, false, pController); -void ZEPlayer::SetEntwatchHudColor(Color colorHud) -{ - m_colorEntwatchHud = colorHud; - std::string strColor = std::to_string(colorHud.r()) + " " + std::to_string(colorHud.g()) + " " + std::to_string(colorHud.b()) + " " + std::to_string(colorHud.a()); - g_pUserPreferencesSystem->SetPreference(m_slot.Get(), EW_PREF_HUDCOLOR, strColor.c_str()); + g_pEWHandler->hHud->SetHasClass("HudTextPanel", newx, true, pController); + g_pEWHandler->hHud->SetHasClass("HudTextPanel", newy, true, pController); + } - CPointWorldText* pText = GetEntwatchHud(); - if (pText) - { - Color c; - if (colorHud.a() == 255) - c.SetColor(colorHud.r(), colorHud.g(), colorHud.b(), 254); - else - c = colorHud; - pText->m_Color = c; + if (g_pEWHandler->hHudSettings.Get()) + { + g_pEWHandler->hHudSettings->SetDialogVariableString("HudPosXValue", "HudPosX", sNewX, pController); + g_pEWHandler->hHudSettings->SetDialogVariableString("HudPosYValue", "HudPosY", sNewY, pController); + } } + + m_iEntwatchHudX = x; + m_iEntwatchHudY = y; + g_pUserPreferencesSystem->SetPreferenceInt(m_slot.Get(), EW_PREF_HUDPOS_X, m_iEntwatchHudX); + g_pUserPreferencesSystem->SetPreferenceInt(m_slot.Get(), EW_PREF_HUDPOS_Y, m_iEntwatchHudY); } -void ZEPlayer::SetEntwatchHudPos(float x, float y) +void ZEPlayer::SetEntwatchHudSize(int iSize) { - m_flEntwatchHudX = x; - m_flEntwatchHudY = y; - g_pUserPreferencesSystem->SetPreferenceFloat(m_slot.Get(), EW_PREF_HUDPOS_X, m_flEntwatchHudX); - g_pUserPreferencesSystem->SetPreferenceFloat(m_slot.Get(), EW_PREF_HUDPOS_Y, m_flEntwatchHudY); + const std::string sOldSize = std::to_string(m_iEntwatchHudSize); + const std::string sNewSize = std::to_string(iSize); - CreateEntwatchHud(); -} + CCSPlayerController* pController = CCSPlayerController::FromSlot(GetPlayerSlot()); + if (pController) + { + std::string oldText = EW_HUDSIZE_CLASS + sOldSize; + std::string newText = EW_HUDSIZE_CLASS + sNewSize; + // Remove old + if (g_pEWHandler->hHud.Get()) + { + g_pEWHandler->hHud->SetHasClass("HudTextPanel", oldText, false, pController); + g_pEWHandler->hHud->SetHasClass("HudTextPanel", newText, true, pController); + } -void ZEPlayer::SetEntwatchHudSize(float flSize) -{ - m_flEntwatchHudSize = flSize; - g_pUserPreferencesSystem->SetPreferenceFloat(m_slot.Get(), EW_PREF_HUDSIZE, m_flEntwatchHudSize); + // Set settings menu text + if (g_pEWHandler->hHudSettings.Get()) + g_pEWHandler->hHudSettings->SetDialogVariableString("HudSizeValue", "Scale", sNewSize, pController); + } - CPointWorldText* pText = GetEntwatchHud(); - if (pText) - pText->m_flFontSize = m_flEntwatchHudSize; + m_iEntwatchHudSize = iSize; + g_pUserPreferencesSystem->SetPreferenceInt(m_slot.Get(), EW_PREF_HUDSIZE, m_iEntwatchHudSize); } void CPlayerManager::OnBotConnected(CPlayerSlot slot) @@ -1184,21 +1140,6 @@ void CPlayerManager::UpdatePlayerStates() pPlayer->SetPlayerState(iCurrentPlayerState); } - - // Update entwatch hud position - if (g_cvarEnableEntWatch.Get() && g_cvarEnableEntwatchHud.Get()) - { - CCSPlayerPawn* pPawn = pController->GetPlayerPawn(); - if (!pPawn) - continue; - - CPointOrient* pOrient = pPlayer->GetPointOrient(); - if (pOrient) - { - Vector origin = pPawn->GetEyePosition(); - pOrient->Teleport(&origin, nullptr, nullptr); - } - } } } diff --git a/src/playermanager.h b/src/playermanager.h index 9753fec7..4c1bce9f 100644 --- a/src/playermanager.h +++ b/src/playermanager.h @@ -20,8 +20,6 @@ #pragma once #include "common.h" #include "entity/cparticlesystem.h" -#include "entity/cpointorient.h" -#include "entity/cpointworldtext.h" #include "entity/customplayercamera.h" #include "entity/lights.h" #include "gamesystem.h" @@ -197,11 +195,12 @@ class ZEPlayer m_pActiveZRClass = nullptr; m_pActiveZRModel = nullptr; m_iButtonWatchMode = 0; - m_iEntwatchHudMode = 0; - m_colorEntwatchHud = Color(255, 255, 255, 255); - m_flEntwatchHudX = -7.5f; - m_flEntwatchHudY = -2.0f; - m_flEntwatchHudSize = 60.0f; + m_bEntwatchHud = false; + m_bEntwatchPlayerNames = true; + m_iEntwatchColor = 0; + m_iEntwatchHudX = 6; + m_iEntwatchHudY = 35; + m_iEntwatchHudSize = 100; m_bTopDefender = false; m_flLastVoiceTime = -15.0f; m_flBeaconEnabledTime = -2.0f; @@ -270,12 +269,11 @@ class ZEPlayer void ReplicateConVar(const char* pszName, const char* pszValue); void SetActiveZRClass(std::shared_ptr pZRModel) { m_pActiveZRClass = pZRModel; } void SetActiveZRModel(std::shared_ptr pZRClass) { m_pActiveZRModel = pZRClass; } - void SetEntwatchHudMode(int iMode); - void SetPointOrient(CPointOrient* pOrient) { m_hPointOrient.Set(pOrient); } - void SetEntwatchHud(CPointWorldText* pWorldText) { m_hEntwatchHud.Set(pWorldText); } - void SetEntwatchHudColor(Color colorHud); - void SetEntwatchHudPos(float x, float y); - void SetEntwatchHudSize(float flSize); + void SetEntwatchHudEnabled(bool bEnabled); + void SetEntwatchPlayerNames(bool bEnabled); + void SetEntwatchHudColor(int iColorIndex); + void SetEntwatchHudPos(int x, int y); + void SetEntwatchHudSize(int iSize); void SetTopDefenderStatus(bool bStatus) { m_bTopDefender = bStatus; } void SetLastVoiceTime(float flTime) { m_flLastVoiceTime = flTime; } void SetBeaconEnabledTime(float flTime) { m_flBeaconEnabledTime = flTime; } @@ -326,13 +324,12 @@ class ZEPlayer std::shared_ptr GetActiveZRClass() { return m_pActiveZRClass; } std::shared_ptr GetActiveZRModel() { return m_pActiveZRModel; } int GetButtonWatchMode(); - int GetEntwatchHudMode(); - CPointOrient* GetPointOrient() { return m_hPointOrient.Get(); } - CPointWorldText* GetEntwatchHud() { return m_hEntwatchHud.Get(); } - Color GetEntwatchHudColor() { return m_colorEntwatchHud; } - float GetEntwatchHudX() { return m_flEntwatchHudX; } - float GetEntwatchHudY() { return m_flEntwatchHudY; } - float GetEntwatchHudSize() { return m_flEntwatchHudSize; } + bool GetEntwatchHudEnabled() { return m_bEntwatchHud; } + bool GetEntwatchPlayerNames() { return m_bEntwatchPlayerNames; } + int GetEntwatchHudColor() { return m_iEntwatchColor; } + int GetEntwatchHudX() { return m_iEntwatchHudX; } + int GetEntwatchHudY() { return m_iEntwatchHudY; } + int GetEntwatchHudSize() { return m_iEntwatchHudSize; } bool GetTopDefenderStatus() { return m_bTopDefender; } float GetLastVoiceTime() { return m_flLastVoiceTime; } float GetBeaconEnabledTime() { return m_flBeaconEnabledTime; } @@ -405,14 +402,13 @@ class ZEPlayer std::shared_ptr m_pActiveZRClass; std::shared_ptr m_pActiveZRModel; int m_iButtonWatchMode; - CHandle m_hPointOrient; - CHandle m_hEntwatchHud; CHandle m_hCustomCamera; - int m_iEntwatchHudMode; - Color m_colorEntwatchHud; - float m_flEntwatchHudX; - float m_flEntwatchHudY; - float m_flEntwatchHudSize; + bool m_bEntwatchHud; + bool m_bEntwatchPlayerNames; + int m_iEntwatchColor; + int m_iEntwatchHudX; + int m_iEntwatchHudY; + int m_iEntwatchHudSize; bool m_bTopDefender; float m_flLastVoiceTime; float m_flBeaconEnabledTime; diff --git a/src/user_preferences.cpp b/src/user_preferences.cpp index bb694e16..36c4ffee 100644 --- a/src/user_preferences.cpp +++ b/src/user_preferences.cpp @@ -116,12 +116,12 @@ void CUserPreferencesSystem::OnPutPreferences(int iSlot) int iZSounds = GetPreferenceInt(iSlot, ZSOUNDS_PREF_KEY_NAME, (int)EZSoundsType::ON); // EntWatch - int iEntwatchMode = GetPreferenceInt(iSlot, EW_PREF_HUD_MODE, 0); - float flEntwatchHudposX = GetPreferenceFloat(iSlot, EW_PREF_HUDPOS_X, EW_HUDPOS_X_DEFAULT); - float flEntwatchHudposY = GetPreferenceFloat(iSlot, EW_PREF_HUDPOS_Y, EW_HUDPOS_Y_DEFAULT); - Color ewHudColor; - V_StringToColor(g_pUserPreferencesSystem->GetPreference(iSlot, EW_PREF_HUDCOLOR, "255 255 255 255"), ewHudColor); - float flEntwatchHudSize = GetPreferenceFloat(iSlot, EW_PREF_HUDSIZE, EW_HUDSIZE_DEFAULT); + bool bEntwatchEnabled = (bool)GetPreferenceInt(iSlot, EW_PREF_HUD_MODE, 0); + bool bEntwatchPlayerNames = (bool)GetPreferenceInt(iSlot, EW_PREF_HUD_PLAYERNAMES, 1); + int iEntwatchHudposX = GetPreferenceInt(iSlot, EW_PREF_HUDPOS_X, EW_HUDPOS_X_DEFAULT); + int iEntwatchHudposY = GetPreferenceInt(iSlot, EW_PREF_HUDPOS_Y, EW_HUDPOS_Y_DEFAULT); + int iEntwatchColor = GetPreferenceInt(iSlot, EW_PREF_HUDCOLOR, EW_HUDCOLOR_DEFAULT); + int iEntwatchSize = GetPreferenceInt(iSlot, EW_PREF_HUDSIZE, EW_HUDSIZE_DEFAULT); // Set the values that we just loaded --- the player is guaranteed available g_playerManager->SetPlayerStopSound(iSlot, bStopSound); @@ -136,10 +136,11 @@ void CUserPreferencesSystem::OnPutPreferences(int iSlot) player->CycleButtonWatch(); // Set EntWatch - player->SetEntwatchHudMode(iEntwatchMode); - player->SetEntwatchHudPos(flEntwatchHudposX, flEntwatchHudposY); - player->SetEntwatchHudColor(ewHudColor); - player->SetEntwatchHudSize(flEntwatchHudSize); + player->SetEntwatchHudEnabled(bEntwatchEnabled); + player->SetEntwatchPlayerNames(bEntwatchPlayerNames); + player->SetEntwatchHudPos(iEntwatchHudposX, iEntwatchHudposY); + player->SetEntwatchHudColor(iEntwatchColor); + player->SetEntwatchHudSize(iEntwatchSize); } void CUserPreferencesSystem::PullPreferences(int iSlot) diff --git a/src/virtual_hooks.cpp b/src/virtual_hooks.cpp index 9a31db85..8035ce4f 100644 --- a/src/virtual_hooks.cpp +++ b/src/virtual_hooks.cpp @@ -708,14 +708,6 @@ KHook::Return Hook_CheckTransmit_Post(ISource2GameEntities* pThis, CCheckT if (!g_cvarFlashLightTransmitOthers.Get() && pFlashLight) pInfo->m_pTransmitEntity->Clear(pFlashLight->entindex()); - if (g_cvarEnableEntWatch.Get() && g_pEWHandler->IsConfigLoaded()) - { - // Don't transmit other players' entwatch hud - CPointWorldText* pHud = pController->IsConnected() ? g_playerManager->GetPlayer(j)->GetEntwatchHud() : nullptr; - if (pHud) - pInfo->m_pTransmitEntity->Clear(pHud->entindex()); - } - // Always transmit other players if spectating if (!g_cvarEnableHide.Get() || pSelfController->GetPawnState() == STATE_OBSERVER_MODE) continue; From 867205de1f5f771f9a1b7a26c1dfd60e8b1090ac Mon Sep 17 00:00:00 2001 From: Vauff Date: Sun, 22 Nov 2026 13:24:58 -0500 Subject: [PATCH 2/2] adjustments --- PackageScript | 9 +++++++++ src/entwatch.cpp | 4 ++-- src/playermanager.h | 2 -- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/PackageScript b/PackageScript index 86e3fabf..565cca31 100644 --- a/PackageScript +++ b/PackageScript @@ -136,6 +136,15 @@ for task in MMSPlugin.tasks: materials_cs2f_folder = builder.AddFolder(os.path.join(packages[sdk_name].sdk_name, 'materials', MMSPlugin.metadata['name'])) builder.AddCopy(os.path.join('assets', 'materials', MMSPlugin.metadata['name'], 'leader_defend_mark.vtex_c'), materials_cs2f_folder) + panorama_layout_cs2f_folder = builder.AddFolder(os.path.join(packages[sdk_name].sdk_name, 'panorama', 'layout', 'custom_game', MMSPlugin.metadata['name'])) + builder.AddCopy(os.path.join('assets', 'panorama', 'layout', 'custom_game', MMSPlugin.metadata['name'], 'entwatch_hud.vxml_c'), panorama_layout_cs2f_folder) + builder.AddCopy(os.path.join('assets', 'panorama', 'layout', 'custom_game', MMSPlugin.metadata['name'], 'entwatch_settings.vxml_c'), panorama_layout_cs2f_folder) + + panorama_styles_cs2f_folder = builder.AddFolder(os.path.join(packages[sdk_name].sdk_name, 'panorama', 'styles', 'custom_game', MMSPlugin.metadata['name'])) + builder.AddCopy(os.path.join('assets', 'panorama', 'styles', 'custom_game', MMSPlugin.metadata['name'], 'entwatch_common.vcss_c'), panorama_styles_cs2f_folder) + builder.AddCopy(os.path.join('assets', 'panorama', 'styles', 'custom_game', MMSPlugin.metadata['name'], 'entwatch_hud.vcss_c'), panorama_styles_cs2f_folder) + builder.AddCopy(os.path.join('assets', 'panorama', 'styles', 'custom_game', MMSPlugin.metadata['name'], 'entwatch_settings.vcss_c'), panorama_styles_cs2f_folder) + soundevents_folder = builder.AddFolder(os.path.join(packages[sdk_name].sdk_name, 'soundevents')) builder.AddCopy(os.path.join('assets', 'soundevents', 'soundevents_zr.vsndevts_c'), soundevents_folder) diff --git a/src/entwatch.cpp b/src/entwatch.cpp index 1a40ab6e..9beac6d1 100644 --- a/src/entwatch.cpp +++ b/src/entwatch.cpp @@ -2808,7 +2808,7 @@ CON_COMMAND_CHAT(ew_dump, "- Prints the currently loaded config to console") g_pEWHandler->PrintLoadedConfig(player); } -CON_COMMAND_CHAT(hud, "- Toggle EntWatch HUD") +CON_COMMAND_CHAT(hud, "- Open EntWatch HUD Settings Menu") { if (!g_cvarEnableEntWatch.Get()) return; @@ -2925,7 +2925,7 @@ CON_COMMAND_CHAT(hudcolor, "[color] - Set color of the Entwatch hud") ClientPrint(player, HUD_PRINTTALK, EW_PREFIX "Usage: !hudcolor "); } -CON_COMMAND_CHAT(hudsize, " - Set font size of the EntWatch hud") +CON_COMMAND_CHAT(hudsize, " - Set size of the EntWatch hud") { if (!g_cvarEnableEntWatch.Get()) return; diff --git a/src/playermanager.h b/src/playermanager.h index 4c1bce9f..8f490709 100644 --- a/src/playermanager.h +++ b/src/playermanager.h @@ -349,8 +349,6 @@ class ZEPlayer void StartGlow(Color color, int duration); void EndGlow(); void SetSteamIdAttribute(); - void CreateEntwatchHud(); - void CreatePointOrient(); void ToggleThirdPerson(float flDistance = -65.f, bool bForce = false); private: