hedgewars/uWorld.pas
changeset 13018 0248cf0da834
parent 12831 1fbc0d5a82d0
child 13140 e330feceb662
equal deleted inserted replaced
13017:e2e40700c5cf 13018:0248cf0da834
  1085                 inc(h, Hedgehogs[i].HealthBarHealth);
  1085                 inc(h, Hedgehogs[i].HealthBarHealth);
  1086                 if (h < TeamHealthBarHealth) and (Hedgehogs[i].HealthBarHealth > 0) then
  1086                 if (h < TeamHealthBarHealth) and (Hedgehogs[i].HealthBarHealth > 0) then
  1087                     DrawTexture(15 + h * TeamHealthBarWidth div TeamHealthBarHealth, cScreenHeight + DrawHealthY + smallScreenOffset + 1, SpritesData[sprSlider].Texture);
  1087                     DrawTexture(15 + h * TeamHealthBarWidth div TeamHealthBarHealth, cScreenHeight + DrawHealthY + smallScreenOffset + 1, SpritesData[sprSlider].Texture);
  1088                 end;
  1088                 end;
  1089 
  1089 
  1090         // draw ai kill counter for gfAISurvival
  1090         // draw Lua value, if set
  1091         if (GameFlags and gfAISurvival) <> 0 then
  1091         if (hasLuaTeamValue) then
  1092             begin
  1092             DrawTexture(TeamHealthBarWidth + 22, cScreenHeight + DrawHealthY + smallScreenOffset, LuaTeamValueTex)
       
  1093         // otherwise, draw AI kill counter for gfAISurvival
       
  1094         else if (GameFlags and gfAISurvival) <> 0 then
  1093             DrawTexture(TeamHealthBarWidth + 22, cScreenHeight + DrawHealthY + smallScreenOffset, AIKillsTex);
  1095             DrawTexture(TeamHealthBarWidth + 22, cScreenHeight + DrawHealthY + smallScreenOffset, AIKillsTex);
  1094             end;
       
  1095 
  1096 
  1096         // if highlighted, draw flag and other contents again to keep their colors
  1097         // if highlighted, draw flag and other contents again to keep their colors
  1097         // this approach should be faster than drawing all borders one by one tinted or not
  1098         // this approach should be faster than drawing all borders one by one tinted or not
  1098         if highlight then
  1099         if highlight then
  1099             begin
  1100             begin
  1113                 r.w:= OwnerTex^.w - 4;
  1114                 r.w:= OwnerTex^.w - 4;
  1114                 r.h:= OwnerTex^.h - 4;
  1115                 r.h:= OwnerTex^.h - 4;
  1115                 DrawTextureFromRect(-OwnerTex^.w - NameTagTex^.w - 16, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, OwnerTex)
  1116                 DrawTextureFromRect(-OwnerTex^.w - NameTagTex^.w - 16, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, OwnerTex)
  1116                 end;
  1117                 end;
  1117 
  1118 
  1118             if (GameFlags and gfAISurvival) <> 0 then
  1119             if (hasLuaTeamValue) then
       
  1120                 begin
       
  1121                 r.w:= LuaTeamValueTex^.w - 4;
       
  1122                 r.h:= LuaTeamValueTex^.h - 4;
       
  1123                 DrawTextureFromRect(TeamHealthBarWidth + 24, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, LuaTeamValueTex);
       
  1124                 end
       
  1125             else if (GameFlags and gfAISurvival) <> 0 then
  1119                 begin
  1126                 begin
  1120                 r.w:= AIKillsTex^.w - 4;
  1127                 r.w:= AIKillsTex^.w - 4;
  1121                 r.h:= AIKillsTex^.h - 4;
  1128                 r.h:= AIKillsTex^.h - 4;
  1122                 DrawTextureFromRect(TeamHealthBarWidth + 24, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, AIKillsTex);
  1129                 DrawTextureFromRect(TeamHealthBarWidth + 24, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, AIKillsTex);
  1123                 end;
  1130                 end;