Tweak appear/disappear animation of touch widgets
authorWuzzy <Wuzzy2@mail.ru>
Thu, 10 Jan 2019 18:45:04 +0100
changeset 14563 e68b91abbcf5
parent 14562 42f7ce0f5bc6
child 14564 78363dbfd5dc
Tweak appear/disappear animation of touch widgets
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Thu Jan 10 18:30:14 2019 +0100
+++ b/hedgewars/uWorld.pas	Thu Jan 10 18:45:04 2019 +0100
@@ -2148,17 +2148,20 @@
     if ((Ammoz[ammoType].Ammo.Propz and ammoprop_Timerable) <> 0) and (ammoType <> amDrillStrike) then
         begin
         utilityWidget.sprite:= sprTimerButton;
-        animateWidget(@utilityWidget, true, true);
+        if (not utilityWidget.show) then
+            animateWidget(@utilityWidget, true, true);
         end
     else if (Ammoz[ammoType].Ammo.Propz and ammoprop_NeedTarget) <> 0 then
         begin
         utilityWidget.sprite:= sprTargetButton;
-        animateWidget(@utilityWidget, true, true);
+        if (not utilityWidget.show) then
+            animateWidget(@utilityWidget, true, true);
         end
     else if ammoType = amSwitch then
         begin
         utilityWidget.sprite:= sprSwitchButton;
-        animateWidget(@utilityWidget, true, true);
+        if (not utilityWidget.show) then
+            animateWidget(@utilityWidget, true, true);
         end
     else if utilityWidget.show then
         animateWidget(@utilityWidget, true, false);
@@ -2166,7 +2169,8 @@
     if ((Ammoz[ammoType].Ammo.Propz and ammoprop_SetBounce) <> 0) then
         begin
         utilityWidget2.sprite:= sprBounceButton;
-        animateWidget(@utilityWidget2, true, true);
+        if (not utilityWidget2.show) then
+            animateWidget(@utilityWidget2, true, true);
         end
     else if utilityWidget2.show then
         animateWidget(@utilityWidget2, true, false);