543 // Teams Healths |
543 // Teams Healths |
544 |
544 |
545 for t:= 0 to Pred(TeamsCount) do |
545 for t:= 0 to Pred(TeamsCount) do |
546 with TeamsArray[t]^ do |
546 with TeamsArray[t]^ do |
547 begin |
547 begin |
548 highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500); |
548 highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500); |
549 |
549 |
550 if highlight then |
550 if highlight then |
551 glColor4f(((Clan^.Color shr 16) and $ff) / $ff, ((Clan^.Color shr 8) and $ff) / $ff, (Clan^.Color and $ff) / $ff, 1); |
551 glColor4f(((Clan^.Color shr 16) and $ff) / $ff, ((Clan^.Color shr 8) and $ff) / $ff, (Clan^.Color and $ff) / $ff, 1); |
552 DrawTexture(- NameTagTex^.w - 16, cScreenHeight + DrawHealthY, NameTagTex); |
552 |
553 |
553 // draw name |
|
554 DrawTexture(-NameTagTex^.w - 16, cScreenHeight + DrawHealthY, NameTagTex); |
|
555 |
|
556 // draw flag |
|
557 DrawTexture(-14, cScreenHeight + DrawHealthY, FlagTex); |
|
558 |
|
559 // draw health bar |
554 r.x:= 0; |
560 r.x:= 0; |
555 r.y:= 0; |
561 r.y:= 0; |
556 |
|
557 r.w:= 26; |
|
558 r.h:= 19; |
|
559 DrawFromRect(-14, cScreenHeight + DrawHealthY, @r, FlagTex); |
|
560 |
|
561 r.w:= 2 + TeamHealthBarWidth; |
562 r.w:= 2 + TeamHealthBarWidth; |
562 r.h:= HealthTex^.h; |
563 r.h:= HealthTex^.h; |
563 DrawFromRect(14, cScreenHeight + DrawHealthY, @r, HealthTex); |
564 DrawFromRect(14, cScreenHeight + DrawHealthY, @r, HealthTex); |
564 |
565 |
|
566 // draw health bar's right border |
565 inc(r.x, cTeamHealthWidth + 2); |
567 inc(r.x, cTeamHealthWidth + 2); |
566 r.w:= 3; |
568 r.w:= 3; |
567 |
|
568 DrawFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY, @r, HealthTex); |
569 DrawFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY, @r, HealthTex); |
569 if highlight then // if highlighted, draw flag again to keep its colors |
570 // if highlighted, draw flag and other contents again to keep their colors |
|
571 // this approach should be faster than drawing all borders one by one tinted or not |
|
572 if highlight then |
570 begin |
573 begin |
|
574 glColor4f(1, 1, 1, 1); |
|
575 |
|
576 // draw name |
571 r.x:= 2; |
577 r.x:= 2; |
572 r.y:= 2; |
578 r.y:= 2; |
|
579 r.w:= NameTagTex^.w - 4; |
|
580 r.h:= NameTagTex^.h - 4; |
|
581 DrawFromRect(-NameTagTex^.w - 14, cScreenHeight + DrawHealthY + 2, @r, NameTagTex); |
|
582 // draw flag |
573 r.w:= 22; |
583 r.w:= 22; |
574 r.h:= 15; |
584 r.h:= 15; |
575 glColor4f(1, 1, 1, 1); |
|
576 DrawFromRect(-12, cScreenHeight + DrawHealthY + 2, @r, FlagTex); |
585 DrawFromRect(-12, cScreenHeight + DrawHealthY + 2, @r, FlagTex); |
|
586 // draw health bar |
|
587 r.w:= TeamHealthBarWidth + 1; |
|
588 r.h:= HealthTex^.h - 4; |
|
589 DrawFromRect(16, cScreenHeight + DrawHealthY + 2, @r, HealthTex); |
577 end; |
590 end; |
578 end; |
591 end; |
579 |
592 |
580 // Lag alert |
593 // Lag alert |
581 if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12); |
594 if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12); |