# HG changeset patch # User Xeli # Date 1329410883 -3600 # Node ID 79c96abd06d63fb3a3c59ebc66f4505a2c68304e # Parent 46b3f477653842c63d1a3bc7c80d6684c9fab238 added hide/show animation for the aiming keys (should animateWidget() be moved to another unit?) diff -r 46b3f4776538 -r 79c96abd06d6 hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Thu Feb 16 20:32:47 2012 +0400 +++ b/hedgewars/uTeams.pas Thu Feb 16 17:48:03 2012 +0100 @@ -20,7 +20,7 @@ unit uTeams; interface -uses uConsts, uKeys, uGears, uRandom, uFloat, uStats, uVisualGears, uCollisions, GLunit, uSound, uTypes; +uses uConsts, uKeys, uGears, uRandom, uFloat, uStats, uVisualGears, uCollisions, GLunit, uSound, uTypes, uWorld; procedure initModule; procedure freeModule; @@ -183,7 +183,24 @@ until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil); CurrentHedgehog:= @(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]); - +{$IFDEF USE_TOUCH_INTERFACE} +if (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoCrosshair) = 0 then + begin + if not(arrowUp.show) then + begin + animateWidget(@arrowUp, true, true); + animateWidget(@arrowDown, true, true); + animateWidget(@arrowRight, false, true); + end; + end +else + if arrowUp.show then + begin + animateWidget(@arrowUp, true, false); + animateWidget(@arrowDown, true, false); + animateWidget(@arrowRight, false, true); + end; +{$ENDIF} AmmoMenuInvalidated:= true; end; diff -r 46b3f4776538 -r 79c96abd06d6 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Thu Feb 16 20:32:47 2012 +0400 +++ b/hedgewars/uWorld.pas Thu Feb 16 17:48:03 2012 +0100 @@ -618,6 +618,24 @@ SetWeapon(Ammo^[Slot, Pos].AmmoType); bSelected:= false; FreeWeaponTooltip; +{$IFDEF USE_TOUCH_INTERFACE}//show the aiming buttons + animation + if (Ammo^[Slot, Pos].Propz and ammoprop_NoCrosshair) = 0 then + begin + if not(arrowUp.show) then + begin + animateWidget(@arrowUp, true, true); + animateWidget(@arrowDown, true, true); + animateWidget(@arrowRight, false, true); + end; + end + else + if arrowUp.show then + begin + animateWidget(@arrowUp, true, false); + animateWidget(@arrowDown, true, false); + animateWidget(@arrowRight, false, true); + end; +{$ENDIF} exit end;