From b33174df8d24368bb6f7df6e7440ef0e0e03e3bc Mon Sep 17 00:00:00 2001 From: shavitush Date: Sun, 6 Aug 2017 10:51:50 +0300 Subject: [PATCH] Added new default zone sprite. (#462) Also made the zone creation preview sprite more translucent and the grid snap beam white. --- materials/shavit/zone_beam.vmt | 6 ++++++ materials/shavit/zone_beam.vtf | Bin 0 -> 1512 bytes scripting/shavit-zones.sp | 12 +++++++----- 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 materials/shavit/zone_beam.vmt create mode 100644 materials/shavit/zone_beam.vtf diff --git a/materials/shavit/zone_beam.vmt b/materials/shavit/zone_beam.vmt new file mode 100644 index 00000000..0d621274 --- /dev/null +++ b/materials/shavit/zone_beam.vmt @@ -0,0 +1,6 @@ +"Sprite" +{ + "$spriteorientation" "vp_parallel" + "$spriteorigin" "[ 0.50 0.50 ]" + "$basetexture" "shavit/zone_beam" +} diff --git a/materials/shavit/zone_beam.vtf b/materials/shavit/zone_beam.vtf new file mode 100644 index 0000000000000000000000000000000000000000..073156af858fe49fcab17576a944ea017420af25 GIT binary patch literal 1512 zcmbtUL1^1n7?$R`RY-*eGsL@18yZcWM+n4ZDVW$U-Kd~oQrq(!p@ev)CZS*mE{_pR zA;*MWnv50ZlP9{v#9&2+9b^nG-eARt4ceQ@AqSV5V!EvwrS$cCa!fDvDD(sAm-P7F z|9}7g>E$w?38w@>5OF1NeTX}c{GDTB=ETyq^Cy@7oH)5O{BmPS#=|LolN6!p1wWXO z#C+{2k~1iM zzxIhrVq}`Jd|MO)Siiq@1NdwIZiE8A?C(fXLI`8eTrm&`JpG=r17NgXu{1SCh{o8H zt@i-NrkXA6AFiz{c}lC{8rFedJB(!jzMg2cT3PE}#6x!mnG0**Z6Lp~f3(XKP^8F|>=Gc&5zJvOqpWagh z-~V;xY-$Z?I5PC}b7EZn2fqG0`$N8_ih^kxChr4|uXxtl!~Y{s@bf_q27{x#qsUKE P-oL;1KR?b7|DcXn9n5`{ literal 0 HcmV?d00001 diff --git a/scripting/shavit-zones.sp b/scripting/shavit-zones.sp index cfed660f..fe29012d 100644 --- a/scripting/shavit-zones.sp +++ b/scripting/shavit-zones.sp @@ -1822,13 +1822,13 @@ public Action Timer_DrawEverything(Handle Timer) return Plugin_Continue; } -int[] GetZoneColors(int type) +int[] GetZoneColors(int type, int customalpha = 0) { int colors[4]; colors[0] = gA_ZoneSettings[type][iRed]; colors[1] = gA_ZoneSettings[type][iGreen]; colors[2] = gA_ZoneSettings[type][iBlue]; - colors[3] = gA_ZoneSettings[type][iAlpha]; + colors[3] = (customalpha > 0)? customalpha:gA_ZoneSettings[type][iAlpha]; return colors; } @@ -1881,10 +1881,12 @@ public Action Timer_Draw(Handle Timer, any data) float points[8][3]; points[0] = gV_Point1[client]; points[7] = origin; - CreateZonePoints(points, gF_Offset); - DrawZone(points, GetZoneColors(gI_ZoneType[client]), 0.1, gA_ZoneSettings[gI_ZoneType[client]][fWidth], false, origin); + // This is here to make the zone setup grid snapping be 1:1 to how it looks when done with the setup. + origin = points[7]; + + DrawZone(points, GetZoneColors(gI_ZoneType[client], 25), 0.1, gA_ZoneSettings[gI_ZoneType[client]][fWidth], false, origin); if(gI_ZoneType[client] == Zone_Teleport && !EmptyVector(gV_Teleport[client])) { @@ -1897,7 +1899,7 @@ public Action Timer_Draw(Handle Timer, any data) { origin[2] -= gF_Height; - TE_SetupBeamPoints(vPlayerOrigin, origin, gI_BeamSprite, gI_HaloSprite, 0, 0, 0.1, 3.5, 3.5, 0, 0.0, {230, 83, 124, 175}, 0); + TE_SetupBeamPoints(vPlayerOrigin, origin, gI_BeamSprite, gI_HaloSprite, 0, 0, 0.1, 1.0, 1.0, 0, 0.0, {255, 255, 255, 230}, 0); TE_SendToAll(0.0); }