Add status indicators (low grav / extra dmg) in touch interface
authorWuzzy <Wuzzy2@mail.ru>
Mon, 26 Nov 2018 17:59:27 +0100
changeset 14320 5cff42e1dd92
parent 14319 00b56ec8b7df
child 14321 79e07510b8e3
Add status indicators (low grav / extra dmg) in touch interface
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Mon Nov 26 14:48:38 2018 +0100
+++ b/hedgewars/uWorld.pas	Mon Nov 26 17:59:27 2018 +0100
@@ -1575,19 +1575,26 @@
         end
     end;
 
-{$IFNDEF USE_TOUCH_INTERFACE}
 // Indicators for global effects (extra damage, low gravity)
-// TODO: Add support for touch interface (need to find out correct offset)
 if UIDisplay <> uiNone then
     begin
+{$IFDEF USE_TOUCH_INTERFACE}
+    offsetX:= (cScreenWidth shr 1) - 95;
+    offsetY:= cScreenHeight - 21;
+{$ELSE}
     offsetX:= 45;
     offsetY:= 51;
+{$ENDIF}
 
     if cDamageModifier = _1_5 then
         begin
             DrawTextureF(ropeIconTex, 1, (cScreenWidth shr 1) - offsetX, cScreenHeight - offsetY, 0, 1, 32, 32);
             DrawTextureF(SpritesData[sprAMAmmos].Texture, 0.90, (cScreenWidth shr 1) - offsetX, cScreenHeight - offsetY, ord(amExtraDamage) - 1, 1, 32, 32);
+{$IFDEF USE_TOUCH_INTERFACE}
+            offsetX := offsetX - 33
+{$ELSE}
             offsetX := offsetX + 33
+{$ENDIF}
         end;
     if (cLowGravity) or ((GameFlags and gfLowGravity) <> 0) then
         begin
@@ -1595,7 +1602,6 @@
             DrawTextureF(SpritesData[sprAMAmmos].Texture, 0.90, (cScreenWidth shr 1) - offsetX, cScreenHeight - offsetY, ord(amLowGravity) - 1, 1, 32, 32);
         end;
     end;
-{$ENDIF}
 
 // Chat
 DrawChat;