hedgewars/uInputHandler.pas
changeset 9693 9e31e3bb4476
parent 9678 aa349a876c93
child 9714 54d756b6dbb1
equal deleted inserted replaced
9690:6a1748b71df2 9693:9e31e3bb4476
   168     begin
   168     begin
   169     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;
   169     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;
   170 
   170 
   171     if KeyDown then
   171     if KeyDown then
   172         begin
   172         begin
       
   173         if CurrentBinds[code] = 'switch' then
       
   174             LocalMessage:= LocalMessage or gmSwitch;
       
   175             
   173         ParseCommand(CurrentBinds[code], Trusted);
   176         ParseCommand(CurrentBinds[code], Trusted);
   174         if (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (ReadyTimeLeft > 1) then
   177         if (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (ReadyTimeLeft > 1) then
   175             ParseCommand('gencmd R', true)
   178             ParseCommand('gencmd R', true)
   176         end
   179         end
   177     else if (CurrentBinds[code][1] = '+') then
   180     else if (CurrentBinds[code][1] = '+') then
   179         s:= CurrentBinds[code];
   182         s:= CurrentBinds[code];
   180         s[1]:= '-';
   183         s[1]:= '-';
   181         ParseCommand(s, Trusted);
   184         ParseCommand(s, Trusted);
   182         if (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (ReadyTimeLeft > 1) then
   185         if (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (ReadyTimeLeft > 1) then
   183             ParseCommand('gencmd R', true)
   186             ParseCommand('gencmd R', true)
   184         end;
   187         end
       
   188     else
       
   189         begin
       
   190         if CurrentBinds[code] = 'switch' then
       
   191             LocalMessage:= LocalMessage and not(gmSwitch)
       
   192         end
   185     end
   193     end
   186 end;
   194 end;
   187 
   195 
   188 procedure ProcessKey(event: TSDL_KeyboardEvent); inline;
   196 procedure ProcessKey(event: TSDL_KeyboardEvent); inline;
   189 var code: LongInt;
   197 var code: LongInt;