From 91055c45babff9add04a525d5b62ddaed38abe14 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Sun, 4 Jul 2010 00:38:57 +0300 Subject: [PATCH] better aspect check on the lead image in the score panel --- .../{num_leading_1.tga => num_leading.tga} | Bin gfx/hud/default/num_leading_2.tga | Bin 15148 -> 0 bytes gfx/hud/default/num_leading_3.tga | Bin 15788 -> 0 bytes .../{num_leading_1.tga => num_leading.tga} | Bin gfx/hud/wickedhud/num_leading_2.tga | Bin 15148 -> 0 bytes gfx/hud/wickedhud/num_leading_3.tga | Bin 15788 -> 0 bytes qcsrc/client/hud.qc | 19 +++++++++++++++--- 7 files changed, 16 insertions(+), 3 deletions(-) rename gfx/hud/default/{num_leading_1.tga => num_leading.tga} (100%) delete mode 100644 gfx/hud/default/num_leading_2.tga delete mode 100644 gfx/hud/default/num_leading_3.tga rename gfx/hud/wickedhud/{num_leading_1.tga => num_leading.tga} (100%) delete mode 100644 gfx/hud/wickedhud/num_leading_2.tga delete mode 100644 gfx/hud/wickedhud/num_leading_3.tga diff --git a/gfx/hud/default/num_leading_1.tga b/gfx/hud/default/num_leading.tga similarity index 100% rename from gfx/hud/default/num_leading_1.tga rename to gfx/hud/default/num_leading.tga diff --git a/gfx/hud/default/num_leading_2.tga b/gfx/hud/default/num_leading_2.tga deleted file mode 100644 index a9be88c6efd0643ed46f11f7c22748c1cd6c2603..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15148 zcmeI3=}sG06vsUn2sSneeS&^#Dg_!U;|1e{MoJ~5s+GE_kAq30R(%wn0SP{^NC+Vo zp@6Iiv6y`cPcZ%ej%TcKpe+qD_J?cf-kCG^EPtPS&YAJ`+*m9btAD(S*ylZeLB92U z-}5IXCOY2J8EFH5GCIj(BXJ==htgfy;nVXyIFR!n!_xp>Bi=Vxt zGcw5l3@{=fJiSpoC=LunykIaU8?l%dqF7MFSJW}Jwzl@g(a}*xZMdv1>#NIE=!{G- zpq7CVfk3b)n3Y>Fn0f1Ly3;akuE2vxVIEhntgNK<&7WReTx71Ut}-7!d>B^Ciq7en z^Euh3OG5^iv#`M~I)gZBP>0%Zq8c1igMv>CPb$QtqfJeSXLoluy|J*GZ{D*B`ws)?&bpSPnI}c`iu&uq=7NN~w8ZQ>#Z9`AUou7NN&b ztgmml$^i1fAsD4Mnyr$ra4K!m8R;vj+zUdC@2>>RPe9x3@Ryt1Io$8A&!3VSo_<1W_P*2!$xdKv=G2 zoY3(4Zi`>VaY{aZCii}&uk*E>o)Mi@%b%Q_(8#cYual8ox;{uQtL0&X9WlgFBl;O? zqmu##%%=kk^`H>o#MahUT1p2b{9GXjhG99IGD2|BYWDZB4=a$&Hf*pXhPbW|pboX9 zXpl2;%%(!yI3~;yMNprd_+0L7m;szzcYYP;ryv90*Zqzd;;6x9boOtxDFsRHa1z9U z7JG!ACeI>I$6Da&r1~laN!;l;2Ajl7h#`&|)ZN*p6xc09P8yN3s7obMUdI>Irk7Q^ z6l8Fj)Ek9eEr+6>Zc&ZnrAptdxsE5 zOS=p`;ak&O;;0|R}-9Xo99~!=0oO6D{6wPxBvKjd+&RhtGDi%y0*CBemev! zBmenZ(A8T#+Pdf4Px|fP>aDA{uHN2#9n3x7y7h$ntkt-B>*}qmx31ns{{wLA32r^X z)r7m(1h;cUM6>@5Nw0M!W7|u}wA> zSnap>r``5R86M^`*uxU+pQ!I+V_yTe1s$8VcdVWE(zR|!;lu5kY|gIF`|Lyg_Z_Z; bC!e2x{N?qp<3El6@cqDV-;RIxdNB4km$gJ3 diff --git a/gfx/hud/default/num_leading_3.tga b/gfx/hud/default/num_leading_3.tga deleted file mode 100644 index ebd35a4e83eec6d593abf2c73123d0077c06e716..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15788 zcmeI3*-j%z6o%bwgN@A$d4k+!A`N7Sj2DatGSWmsiV`WC@;I2uC{Z4TXF!4r76~E5 zA~YatgjmeJK0)XIj=Qb);0uyrY+sb6DpyyX^Pk_RPMx;fRk2ti7Q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nQIJm+&cCJ_@sM)w zuv~2UTM5F_rV>LWZC1z=N%|z8Lne~9hrs}={SCLw)nTq~dT?RbC6J~i5a;TqxtcuN z^ySpD1mbcvx4Nd>7G17(U+C@Ei~9*v{XzHXKiXWbcHgV3&!ZmsCydM0E?2u;t?%5A z_khjiYL}~Bu6EC>-4puu|1-qpYL}~Bu6DWFP6onm;O=a+7G8tKBmY z_YA~6198tl+&+*8Z$NRm+NDgFG9NW%wruAM&p_Coro~?riO;_UmJPbi*!0`-?auA9 z@tbYv>;iB7X81NcCSXSwT7P(=&5xM0{Sh6G>9qABCp(H|!Pch7#M<(3osnW{gF{ZF zFt+=v)J}+TH_>62&wKQ+?G9zO_>gLokK}&F!^NL`@c99UtBGJ|aBhIhX(d diff --git a/gfx/hud/wickedhud/num_leading_1.tga b/gfx/hud/wickedhud/num_leading.tga similarity index 100% rename from gfx/hud/wickedhud/num_leading_1.tga rename to gfx/hud/wickedhud/num_leading.tga diff --git a/gfx/hud/wickedhud/num_leading_2.tga b/gfx/hud/wickedhud/num_leading_2.tga deleted file mode 100644 index a9be88c6efd0643ed46f11f7c22748c1cd6c2603..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15148 zcmeI3=}sG06vsUn2sSneeS&^#Dg_!U;|1e{MoJ~5s+GE_kAq30R(%wn0SP{^NC+Vo zp@6Iiv6y`cPcZ%ej%TcKpe+qD_J?cf-kCG^EPtPS&YAJ`+*m9btAD(S*ylZeLB92U z-}5IXCOY2J8EFH5GCIj(BXJ==htgfy;nVXyIFR!n!_xp>Bi=Vxt zGcw5l3@{=fJiSpoC=LunykIaU8?l%dqF7MFSJW}Jwzl@g(a}*xZMdv1>#NIE=!{G- zpq7CVfk3b)n3Y>Fn0f1Ly3;akuE2vxVIEhntgNK<&7WReTx71Ut}-7!d>B^Ciq7en z^Euh3OG5^iv#`M~I)gZBP>0%Zq8c1igMv>CPb$QtqfJeSXLoluy|J*GZ{D*B`ws)?&bpSPnI}c`iu&uq=7NN~w8ZQ>#Z9`AUou7NN&b ztgmml$^i1fAsD4Mnyr$ra4K!m8R;vj+zUdC@2>>RPe9x3@Ryt1Io$8A&!3VSo_<1W_P*2!$xdKv=G2 zoY3(4Zi`>VaY{aZCii}&uk*E>o)Mi@%b%Q_(8#cYual8ox;{uQtL0&X9WlgFBl;O? zqmu##%%=kk^`H>o#MahUT1p2b{9GXjhG99IGD2|BYWDZB4=a$&Hf*pXhPbW|pboX9 zXpl2;%%(!yI3~;yMNprd_+0L7m;szzcYYP;ryv90*Zqzd;;6x9boOtxDFsRHa1z9U z7JG!ACeI>I$6Da&r1~laN!;l;2Ajl7h#`&|)ZN*p6xc09P8yN3s7obMUdI>Irk7Q^ z6l8Fj)Ek9eEr+6>Zc&ZnrAptdxsE5 zOS=p`;ak&O;;0|R}-9Xo99~!=0oO6D{6wPxBvKjd+&RhtGDi%y0*CBemev! zBmenZ(A8T#+Pdf4Px|fP>aDA{uHN2#9n3x7y7h$ntkt-B>*}qmx31ns{{wLA32r^X z)r7m(1h;cUM6>@5Nw0M!W7|u}wA> zSnap>r``5R86M^`*uxU+pQ!I+V_yTe1s$8VcdVWE(zR|!;lu5kY|gIF`|Lyg_Z_Z; bC!e2x{N?qp<3El6@cqDV-;RIxdNB4km$gJ3 diff --git a/gfx/hud/wickedhud/num_leading_3.tga b/gfx/hud/wickedhud/num_leading_3.tga deleted file mode 100644 index ebd35a4e83eec6d593abf2c73123d0077c06e716..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15788 zcmeI3*-j%z6o%bwgN@A$d4k+!A`N7Sj2DatGSWmsiV`WC@;I2uC{Z4TXF!4r76~E5 zA~YatgjmeJK0)XIj=Qb);0uyrY+sb6DpyyX^Pk_RPMx;fRk2ti7QUvuso0mj|8V)v z_kGWwnwsjc>H{t7v(dj1nMNeW0IiPcnVFeRHT-I|OUwFfv?k}7?q2|uB;s`dphgGk z^mNAN=H|L+b@{8StKC+WX<1)ww9_=u1i`Qj^&Q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zHXKiXWbcHgV3&!ZmsCydM0E?2u;t?%5A z_khjiYL}~Bu6EC>-4puu|1-qpYL}~Bu6DWFP6onm;O=a+7G8tKBmY z_YA~6198tl+&+*8Z$NRm+NDgFG9NW%wruAM&p_Coro~?riO;_UmJPbi*!0`-?auA9 z@tbYv>;iB7X81NcCSXSwT7P(=&5xM0{Sh6G>9qABCp(H|!Pch7#M<(3osnW{gF{ZF zFt+=v)J}+TH_>62&wKQ+?G9zO_>gLokK}&F!^NL`@c99UtBGJ|aBhIhX(d diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 04a82ea4d..30d70d287 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -655,6 +655,19 @@ void HUD_Panel_DrawProgressBar(vector pos, float vertical, vector mySize, vector } } +void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float alpha, float drawflag) +{ + if(!alpha) + return; + + string pic; + pic = strcat(hud_skin_path, "/"); + drawsubpic(pos, eX * min(mySize_x * 0.5, mySize_y) + eY * mySize_y, strcat(pic, "num_leading"), '0 0 0', '0.25 1 0', color, alpha, drawflag); + if(mySize_x/mySize_y > 2) + drawsubpic(pos + eX * mySize_y, eX * (mySize_x - 2 * mySize_y) + eY * mySize_y, strcat(pic, "num_leading"), '0.25 0 0', '0.5 1 0', color, alpha, drawflag); + drawsubpic(pos + eX * mySize_x - eX * min(mySize_x * 0.5, mySize_y), eX * min(mySize_x * 0.5, mySize_y) + eY * mySize_y, strcat(pic, "num_leading"), '0.75 0 0', '0.25 1 0', color, alpha, drawflag); +} + // check if move will result in panel being moved into another panel. If so, return snapped vector, otherwise return the given vector vector HUD_Panel_CheckMove(vector myPos, vector mySize) { @@ -3306,7 +3319,7 @@ void HUD_Score(void) drawstring_aspect(pos + eX * 0.75 * mySize_x, ftos(distribution), eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, (1/3) * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL); if (leader) - drawpic_aspect_skin(pos, strcat("num_leading_", ftos(score_len)), eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); drawfont = hud_bigfont; drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL); drawfont = hud_font; @@ -3332,7 +3345,7 @@ void HUD_Score(void) if (max_fragcount == score) leader = 1; if (leader) - drawpic_aspect_skin(pos, strcat("num_leading_", ftos(score_len)), eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); drawfont = hud_bigfont; drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, mySize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL); drawfont = hud_font; @@ -3340,7 +3353,7 @@ void HUD_Score(void) if (max_fragcount == score) leader = 1; if (leader) - drawpic_aspect_skin(pos + eX * 0.75 * mySize_x + eY * (1/3) * teamnum * mySize_y, strcat("num_leading_", ftos(score_len)), eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + HUD_Panel_DrawHighlight(pos + eX * 0.75 * mySize_x + eY * (1/3) * teamnum * mySize_y, eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); drawstring_aspect(pos + eX * 0.75 * mySize_x + eY * (1/3) * teamnum * mySize_y, ftos(score), eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, (1/3) * mySize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL); teamnum += 1; } -- 2.39.2