hedgewars/uTouch.pas
changeset 6956 7d9e2669c2f5
parent 6955 71498ea59193
child 6957 ab8034208fcd
equal deleted inserted replaced
6955:71498ea59193 6956:7d9e2669c2f5
    20 
    20 
    21 unit uTouch;
    21 unit uTouch;
    22 
    22 
    23 interface
    23 interface
    24 
    24 
    25 uses sysutils, uConsole, uVariables, SDLh, uFloat, uConsts, uCommands, uIO, GLUnit, uTypes, uCaptions;
    25 uses sysutils, uConsole, uVariables, SDLh, uFloat, uConsts, uCommands, uIO, GLUnit, uTypes, uCaptions, uAmmos;
    26 
    26 
    27 
    27 
    28 procedure initModule;
    28 procedure initModule;
    29 
    29 
    30 procedure ProcessTouch;
    30 procedure ProcessTouch;
   147     exit;
   147     exit;
   148     end;
   148     end;
   149 
   149 
   150 if isOnWidget(utilityWidget, finger^) then
   150 if isOnWidget(utilityWidget, finger^) then
   151     begin
   151     begin
   152     //ParseCommand('/timer ' + inttostr((CurrentHedgeHog^.CurWeapon^.Timer div 1000 + 1) mod 5));
   152     if(CurrentHedgehog <> nil) then
       
   153         begin
       
   154         if Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_Timerable <> 0 then
       
   155             ParseTeamCommand('/timer ' + inttostr((GetCurAmmoEntry(CurrentHedgeHog^)^.Timer div 1000) mod 5 + 1));
       
   156         end;
   153     end; 
   157     end; 
   154 dec(buttonsDown);//no buttonsDown, undo the inc() above
   158 dec(buttonsDown);//no buttonsDown, undo the inc() above
   155 if buttonsDown = 0 then
   159 if buttonsDown = 0 then
   156     begin
   160     begin
   157     moveCursor:= true;
   161     moveCursor:= true;