Add new Hedgehog.png frame for ammo with SelAmmoIcon
authorWuzzy <Wuzzy2@mail.ru>
Fri, 24 May 2019 19:44:49 +0200
changeset 15061 0dbd06bf90f4
parent 15060 a4a058dcbbd6
child 15062 f764394839b2
Add new Hedgehog.png frame for ammo with SelAmmoIcon
hedgewars/uGearsRender.pas
share/hedgewars/Data/Graphics/Hedgehog.png
--- a/hedgewars/uGearsRender.pas	Fri May 24 16:01:30 2019 +0200
+++ b/hedgewars/uGearsRender.pas	Fri May 24 19:44:49 2019 +0200
@@ -930,13 +930,24 @@
                             0);
                     end
             else
-                DrawHedgehog(sx, sy,
-                    sign,
-                    0,
-                    4,
-                    0);
-
-                HatVisible:= true;
+                // Special hog sprite that makes hog "look" towards the selection icon.
+                // Only works with NoHat for now since it would look weird/creepy for many hats.
+                if (HH^.Hat = 'NoHat') and ((Gear^.State and (gstMoving or gstAttacking)) = 0) and ((Ammoz[amt].Ammo.Propz and ammoprop_ShowSelIcon) <> 0) then
+                    DrawHedgehog(sx, sy,
+                        sign,
+                        0,
+                        6,
+                        0)
+                // Default idle hedgehog
+                else
+                    begin
+                    DrawHedgehog(sx, sy,
+                        sign,
+                        0,
+                        4,
+                        0);
+                    HatVisible:= true;
+                    end;
             end;
 
             defaultPos:= false
Binary file share/hedgewars/Data/Graphics/Hedgehog.png has changed