863 // Target |
863 // Target |
864 if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <> nil) then |
864 if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <> nil) then |
865 begin |
865 begin |
866 with PHedgehog(CurrentHedgehog)^ do |
866 with PHedgehog(CurrentHedgehog)^ do |
867 begin |
867 begin |
868 if (CurAmmoType = amBee) then |
868 if CurAmmoType = amBee then |
869 DrawRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) |
869 DrawRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) |
870 else |
870 else |
871 DrawRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360); |
871 DrawRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) |
872 end; |
872 end |
873 end; |
873 end; |
874 {$WARNINGS ON} |
874 {$WARNINGS ON} |
875 |
875 |
876 // this scale is used to keep the various widgets at the same dimension at all zoom levels |
876 // this scale is used to keep the various widgets at the same dimension at all zoom levels |
877 SetScale(cDefaultZoomLevel); |
877 SetScale(cDefaultZoomLevel); |
905 |
905 |
906 // Captions |
906 // Captions |
907 DrawCaptions; |
907 DrawCaptions; |
908 |
908 |
909 // Teams Healths |
909 // Teams Healths |
|
910 if TeamsCount * 20 > cScreenHeight div 7 then // take up less screen on small displays |
|
911 begin |
|
912 SetScale(1.5); |
|
913 smallScreenOffset:= cScreenHeight div 6; |
|
914 if TeamsCount * 20 > cScreenHeight div 5 then Tint($FF,$FF,$FF,$80); |
|
915 end |
|
916 else smallScreenOffset:= 0; |
910 for t:= 0 to Pred(TeamsCount) do |
917 for t:= 0 to Pred(TeamsCount) do |
911 with TeamsArray[t]^ do |
918 with TeamsArray[t]^ do |
912 begin |
919 begin |
913 highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500); |
920 highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500); |
914 |
921 |
915 if highlight then |
922 if highlight then |
916 Tint(Clan^.Color shl 8 or $FF); |
923 Tint(Clan^.Color shl 8 or $FF); |
917 |
924 |
918 // draw name |
925 // draw name |
919 DrawTexture(-NameTagTex^.w - 16, cScreenHeight + DrawHealthY, NameTagTex); |
926 DrawTexture(-NameTagTex^.w - 16, cScreenHeight + DrawHealthY + smallScreenOffset, NameTagTex); |
920 |
927 |
921 // draw flag |
928 // draw flag |
922 DrawTexture(-14, cScreenHeight + DrawHealthY, FlagTex); |
929 DrawTexture(-14, cScreenHeight + DrawHealthY + smallScreenOffset, FlagTex); |
923 |
930 |
924 // draw health bar |
931 // draw health bar |
925 r.x:= 0; |
932 r.x:= 0; |
926 r.y:= 0; |
933 r.y:= 0; |
927 r.w:= 2 + TeamHealthBarWidth; |
934 r.w:= 2 + TeamHealthBarWidth; |
928 r.h:= HealthTex^.h; |
935 r.h:= HealthTex^.h; |
929 DrawFromRect(14, cScreenHeight + DrawHealthY, @r, HealthTex); |
936 DrawFromRect(14, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex); |
930 |
937 |
931 // draw health bars right border |
938 // draw health bars right border |
932 inc(r.x, cTeamHealthWidth + 2); |
939 inc(r.x, cTeamHealthWidth + 2); |
933 r.w:= 3; |
940 r.w:= 3; |
934 DrawFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY, @r, HealthTex); |
941 DrawFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex); |
935 |
942 |
936 // draw ai kill counter for gfAISurvival |
943 // draw ai kill counter for gfAISurvival |
937 if (GameFlags and gfAISurvival) <> 0 then begin |
944 if (GameFlags and gfAISurvival) <> 0 then begin |
938 DrawTexture(TeamHealthBarWidth + 22, cScreenHeight + DrawHealthY, |
945 DrawTexture(TeamHealthBarWidth + 22, cScreenHeight + DrawHealthY + smallScreenOffset, |
939 AIKillsTex); |
946 AIKillsTex); |
940 end; |
947 end; |
941 |
948 |
942 // if highlighted, draw flag and other contents again to keep their colors |
949 // if highlighted, draw flag and other contents again to keep their colors |
943 // this approach should be faster than drawing all borders one by one tinted or not |
950 // this approach should be faster than drawing all borders one by one tinted or not |
944 if highlight then |
951 if highlight then |
945 begin |
952 begin |
946 Tint($FF, $FF, $FF, $FF); |
953 if TeamsCount * 20 > cScreenHeight div 5 then Tint($FF,$FF,$FF,$80) |
|
954 else Tint($FF, $FF, $FF, $FF); |
947 |
955 |
948 // draw name |
956 // draw name |
949 r.x:= 2; |
957 r.x:= 2; |
950 r.y:= 2; |
958 r.y:= 2; |
951 r.w:= NameTagTex^.w - 4; |
959 r.w:= NameTagTex^.w - 4; |
952 r.h:= NameTagTex^.h - 4; |
960 r.h:= NameTagTex^.h - 4; |
953 DrawFromRect(-NameTagTex^.w - 14, cScreenHeight + DrawHealthY + 2, @r, NameTagTex); |
961 DrawFromRect(-NameTagTex^.w - 14, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, NameTagTex); |
954 // draw flag |
962 // draw flag |
955 r.w:= 22; |
963 r.w:= 22; |
956 r.h:= 15; |
964 r.h:= 15; |
957 DrawFromRect(-12, cScreenHeight + DrawHealthY + 2, @r, FlagTex); |
965 DrawFromRect(-12, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, FlagTex); |
958 // draw health bar |
966 // draw health bar |
959 r.w:= TeamHealthBarWidth + 1; |
967 r.w:= TeamHealthBarWidth + 1; |
960 r.h:= HealthTex^.h - 4; |
968 r.h:= HealthTex^.h - 4; |
961 DrawFromRect(16, cScreenHeight + DrawHealthY + 2, @r, HealthTex); |
969 DrawFromRect(16, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, HealthTex); |
962 end; |
970 end; |
963 end; |
971 end; |
|
972 if smallScreenOffset <> 0 then |
|
973 begin |
|
974 SetScale(zoom); |
|
975 if TeamsCount * 20 > cScreenHeight div 5 then Tint($FF,$FF,$FF,$FF); |
|
976 end; |
964 |
977 |
965 // Lag alert |
978 // Lag alert |
966 if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12); |
979 if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12); |
967 |
980 |
968 // Wind bar |
981 // Wind bar |
1142 if not bShowAmmoMenu then |
1155 if not bShowAmmoMenu then |
1143 begin |
1156 begin |
1144 with CurrentHedgehog^ do |
1157 with CurrentHedgehog^ do |
1145 if (Gear <> nil) and ((Gear^.State and gstHHChooseTarget) <> 0) then |
1158 if (Gear <> nil) and ((Gear^.State and gstHHChooseTarget) <> 0) then |
1146 begin |
1159 begin |
|
1160 if CurAmmoType = amNapalm then |
|
1161 DrawLine(-3000, topY-300, 7000, topY-300, 3.0, (Team^.Clan^.Color shr 16), (Team^.Clan^.Color shr 8) and $FF, Team^.Clan^.Color and $FF, $FF); |
1147 i:= GetAmmoEntry(CurrentHedgehog^)^.Pos; |
1162 i:= GetAmmoEntry(CurrentHedgehog^)^.Pos; |
1148 with Ammoz[CurAmmoType] do |
1163 with Ammoz[CurAmmoType] do |
1149 if PosCount > 1 then |
1164 if PosCount > 1 then |
1150 DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1), cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),i); |
1165 DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1), cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),i); |
1151 end; |
1166 end; |