hedgewars/uWorld.pas
changeset 9693 9e31e3bb4476
parent 9670 1954f692e8c6
child 9720 453a1c29b7e4
equal deleted inserted replaced
9690:6a1748b71df2 9693:9e31e3bb4476
  1437 
  1437 
  1438 // this scale is used to keep the various widgets at the same dimension at all zoom levels
  1438 // this scale is used to keep the various widgets at the same dimension at all zoom levels
  1439 SetScale(cDefaultZoomLevel);
  1439 SetScale(cDefaultZoomLevel);
  1440 
  1440 
  1441 // Turn time
  1441 // Turn time
       
  1442 if UIDisplay <> uiNone then
       
  1443     begin
  1442 {$IFDEF USE_TOUCH_INTERFACE}
  1444 {$IFDEF USE_TOUCH_INTERFACE}
  1443 offsetX:= cScreenHeight - 13;
  1445     offsetX:= cScreenHeight - 13;
  1444 {$ELSE}
  1446 {$ELSE}
  1445 offsetX:= 48;
  1447     offsetX:= 48;
  1446 {$ENDIF}
  1448 {$ENDIF}
  1447 offsetY:= cOffsetY;
  1449     offsetY:= cOffsetY;
  1448 if ((TurnTimeLeft <> 0) and (TurnTimeLeft < 1000000)) or (ReadyTimeLeft <> 0) then
  1450     if ((TurnTimeLeft <> 0) and (TurnTimeLeft < 1000000)) or (ReadyTimeLeft <> 0) then
  1449     begin
  1451         begin
  1450     if ReadyTimeLeft <> 0 then
  1452         if ReadyTimeLeft <> 0 then
  1451         i:= Succ(Pred(ReadyTimeLeft) div 1000)
  1453             i:= Succ(Pred(ReadyTimeLeft) div 1000)
  1452     else
  1454         else
  1453         i:= Succ(Pred(TurnTimeLeft) div 1000);
  1455             i:= Succ(Pred(TurnTimeLeft) div 1000);
  1454    
  1456        
  1455     if i>99 then
  1457         if i>99 then
  1456         t:= 112
  1458             t:= 112
  1457     else if i>9 then
  1459         else if i>9 then
  1458         t:= 96
  1460             t:= 96
  1459     else
  1461         else
  1460         t:= 80;
  1462             t:= 80;
  1461     DrawSprite(sprFrame, -(cScreenWidth shr 1) + t + offsetY, cScreenHeight - offsetX, 1);
  1463         DrawSprite(sprFrame, -(cScreenWidth shr 1) + t + offsetY, cScreenHeight - offsetX, 1);
  1462     while i > 0 do
  1464         while i > 0 do
  1463         begin
  1465             begin
  1464         dec(t, 32);
  1466             dec(t, 32);
  1465         DrawSprite(sprBigDigit, -(cScreenWidth shr 1) + t + offsetY, cScreenHeight - offsetX, i mod 10);
  1467             DrawSprite(sprBigDigit, -(cScreenWidth shr 1) + t + offsetY, cScreenHeight - offsetX, i mod 10);
  1466         i:= i div 10
  1468             i:= i div 10
       
  1469             end;
       
  1470         DrawSprite(sprFrame, -(cScreenWidth shr 1) + t - 4 + offsetY, cScreenHeight - offsetX, 0);
  1467         end;
  1471         end;
  1468     DrawSprite(sprFrame, -(cScreenWidth shr 1) + t - 4 + offsetY, cScreenHeight - offsetX, 0);
       
  1469     end;
       
  1470 
  1472 
  1471 // Captions
  1473 // Captions
  1472 DrawCaptions;
  1474     DrawCaptions
       
  1475     end;
  1473 
  1476 
  1474 {$IFDEF USE_TOUCH_INTERFACE}
  1477 {$IFDEF USE_TOUCH_INTERFACE}
  1475 // Draw buttons Related to the Touch interface
  1478 // Draw buttons Related to the Touch interface
  1476 DrawScreenWidget(@arrowLeft);
  1479 DrawScreenWidget(@arrowLeft);
  1477 DrawScreenWidget(@arrowRight);
  1480 DrawScreenWidget(@arrowRight);
  1483 DrawScreenWidget(@AMWidget);
  1486 DrawScreenWidget(@AMWidget);
  1484 DrawScreenWidget(@pauseButton);
  1487 DrawScreenWidget(@pauseButton);
  1485 DrawScreenWidget(@utilityWidget);
  1488 DrawScreenWidget(@utilityWidget);
  1486 {$ENDIF}
  1489 {$ENDIF}
  1487 
  1490 
  1488 RenderTeamsHealth;
  1491 if UIDisplay = uiAll then
       
  1492     RenderTeamsHealth;
  1489 
  1493 
  1490 // Lag alert
  1494 // Lag alert
  1491 if isInLag then
  1495 if isInLag then
  1492     DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12);
  1496     DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12);
  1493 
  1497 
  1494 // Wind bar
  1498 // Wind bar
       
  1499 if UIDisplay <> uiNone then
       
  1500     begin
  1495 {$IFDEF USE_TOUCH_INTERFACE}
  1501 {$IFDEF USE_TOUCH_INTERFACE}
  1496     offsetX:= cScreenHeight - 13;
  1502     offsetX:= cScreenHeight - 13;
  1497     offsetY:= (cScreenWidth shr 1) + 74;
  1503     offsetY:= (cScreenWidth shr 1) + 74;
  1498 {$ELSE}
  1504 {$ELSE}
  1499     offsetX:= 30;
  1505     offsetX:= 30;
  1511         DrawSpriteFromRect(sprWindR, r, (cScreenWidth shr 1) - offsetY + 77, cScreenHeight - offsetX + 2, 13, 0);
  1517         DrawSpriteFromRect(sprWindR, r, (cScreenWidth shr 1) - offsetY + 77, cScreenHeight - offsetX + 2, 13, 0);
  1512         end
  1518         end
  1513     else
  1519     else
  1514         if WindBarWidth < 0 then
  1520         if WindBarWidth < 0 then
  1515         begin
  1521         begin
  1516             {$WARNINGS OFF}
  1522         {$WARNINGS OFF}
  1517             r.x:= (Longword(WindBarWidth) + RealTicks shr 6) mod 8;
  1523         r.x:= (Longword(WindBarWidth) + RealTicks shr 6) mod 8;
  1518             {$WARNINGS ON}
  1524         {$WARNINGS ON}
  1519             r.y:= 0;
  1525         r.y:= 0;
  1520             r.w:= - WindBarWidth;
  1526         r.w:= - WindBarWidth;
  1521             r.h:= 13;
  1527         r.h:= 13;
  1522             DrawSpriteFromRect(sprWindL, r, (cScreenWidth shr 1) - offsetY + 74 + WindBarWidth, cScreenHeight - offsetX + 2, 13, 0);
  1528         DrawSpriteFromRect(sprWindL, r, (cScreenWidth shr 1) - offsetY + 74 + WindBarWidth, cScreenHeight - offsetX + 2, 13, 0);
  1523         end;
  1529         end
       
  1530     end;
  1524 
  1531 
  1525 // AmmoMenu
  1532 // AmmoMenu
  1526 if bShowAmmoMenu and ((AMState = AMHidden) or (AMState = AMHiding)) then
  1533 if bShowAmmoMenu and ((AMState = AMHidden) or (AMState = AMHiding)) then
  1527     begin
  1534     begin
  1528     if (AMState = AMHidden) then
  1535     if (AMState = AMHidden) then