# HG changeset patch # User nemo # Date 1352069264 18000 # Node ID d00378a37dde633d44b063bd702ded87902cf18b # Parent 99d5af6997dd129ad452c151e668a523fdfc271f Simplify ammo menu conditions so it shows up in more states. Should fix issue #465. The part w/ sliding in uworld is main #465 problem. diff -r 99d5af6997dd -r d00378a37dde hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Sun Nov 04 17:27:54 2012 -0500 +++ b/hedgewars/uCommandHandlers.pas Sun Nov 04 17:47:44 2012 -0500 @@ -598,9 +598,9 @@ if bShowAmmoMenu then bShowAmmoMenu:= false - else if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) + else if not(CurrentTeam^.Extdriven) and (((Gear^.State and (gstAttacking or gstAttacked)) <> 0) or ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) - or ((Gear^.State and gstHHDriven) = 0) then + or ((Gear^.State and gstHHDriven) = 0)) then begin end else diff -r 99d5af6997dd -r d00378a37dde hedgewars/uInputHandler.pas --- a/hedgewars/uInputHandler.pas Sun Nov 04 17:27:54 2012 -0500 +++ b/hedgewars/uInputHandler.pas Sun Nov 04 17:47:44 2012 -0500 @@ -121,7 +121,6 @@ if not(tkbd[code] xor KeyDown) then exit; tkbd[code]:= KeyDown; -hideAmmoMenu:= false; Trusted:= (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (CurrentHedgehog^.BotLevel = 0); @@ -155,7 +154,7 @@ if CurrentBinds[code][0] <> #0 then begin - if (code > 3) and KeyDown and (not ((CurrentBinds[code] = 'put')) or (CurrentBinds[code] = 'ammomenu') or (CurrentBinds[code] = '+cur_u') or (CurrentBinds[code] = '+cur_d') or (CurrentBinds[code] = '+cur_l') or (CurrentBinds[code] = '+cur_r')) then hideAmmoMenu:= true; + if (code > 3) and KeyDown and (not ((CurrentBinds[code] = 'put')) or (CurrentBinds[code] = 'ammomenu') or (CurrentBinds[code] = '+cur_u') or (CurrentBinds[code] = '+cur_d') or (CurrentBinds[code] = '+cur_l') or (CurrentBinds[code] = '+cur_r')) and (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) then bShowAmmoMenu:= false; if KeyDown then begin diff -r 99d5af6997dd -r d00378a37dde hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Sun Nov 04 17:27:54 2012 -0500 +++ b/hedgewars/uVariables.pas Sun Nov 04 17:47:44 2012 -0500 @@ -2509,8 +2509,6 @@ vobSDFrameTicks, vobSDFramesCount, vobSDCount: Longword; vobSDVelocity, vobSDFallSpeed: LongInt; - hideAmmoMenu: boolean; - ControllerNumControllers: Integer; ControllerEnabled: Integer; ControllerNumAxes: array[0..5] of Integer; diff -r 99d5af6997dd -r d00378a37dde hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Sun Nov 04 17:27:54 2012 -0500 +++ b/hedgewars/uWorld.pas Sun Nov 04 17:47:44 2012 -0500 @@ -511,9 +511,7 @@ Ammo: PHHAmmo; c,i,g,t,STurns: LongInt; begin -if (TurnTimeLeft = 0) or (not CurrentTeam^.ExtDriven and (((CurAmmoGear = nil) -or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) = 0)) and hideAmmoMenu)) then - bShowAmmoMenu:= false; +if TurnTimeLeft = 0 then bShowAmmoMenu:= false; // give the assigned ammo to hedgehog Ammo:= nil; @@ -552,16 +550,19 @@ AmmoRect.x:= (cScreenWidth shr 1) - AmmoRect.w - AMSlotSize; AmmoRect.y:= cScreenHeight - (AmmoRect.h + AMSlotSize); {$ENDIF} - AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x; - AMShiftTargetY:= cScreenHeight - AmmoRect.y; + if AMState <> AMShowing then + begin + AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x; + AMShiftTargetY:= cScreenHeight - AmmoRect.y; - if (AMAnimType and AMTypeMaskX) <> 0 then AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x - else AMShiftTargetX:= 0; - if (AMAnimType and AMTypeMaskY) <> 0 then AMShiftTargetY:= cScreenHeight - AmmoRect.y - else AMShiftTargetY:= 0; + if (AMAnimType and AMTypeMaskX) <> 0 then AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x + else AMShiftTargetX:= 0; + if (AMAnimType and AMTypeMaskY) <> 0 then AMShiftTargetY:= cScreenHeight - AmmoRect.y + else AMShiftTargetY:= 0; - AMShiftX:= AMShiftTargetX; - AMShiftY:= AMShiftTargetY; + AMShiftX:= AMShiftTargetX; + AMShiftY:= AMShiftTargetY + end end; AMAnimState:= (RealTicks - AMAnimStartTime) / AMAnimDuration;