hedgewars/uCommandHandlers.pas
changeset 14916 d4a19bf6687e
parent 14770 533ac9774279
child 14917 63357ed39886
equal deleted inserted replaced
14915:5a6da39c5f2a 14916:d4a19bf6687e
    31      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF};
    31      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF};
    32 
    32 
    33 var cTagsMasks : array[0..15] of byte = (7, 0, 0, 0, 0, 4, 5, 6, 15, 8, 8, 8, 8, 12, 13, 14);
    33 var cTagsMasks : array[0..15] of byte = (7, 0, 0, 0, 0, 4, 5, 6, 15, 8, 8, 8, 8, 12, 13, 14);
    34     cTagsMasksNoHealth: array[0..15] of byte = (3, 0, 1, 2, 0, 0, 0, 0, 11, 8, 9, 10, 8, 8, 8, 8);
    34     cTagsMasksNoHealth: array[0..15] of byte = (3, 0, 1, 2, 0, 0, 0, 0, 11, 8, 9, 10, 8, 8, 8, 8);
    35 
    35 
    36 // helper function for volume
       
    37 procedure updateVolumeDelta(precise: boolean);
       
    38 begin
       
    39 if cVolumeUpKey and (not cVolumeDownKey) then
       
    40     if precise then
       
    41         cVolumeDelta:= 1
       
    42     else
       
    43         cVolumeDelta:= 3
       
    44 else if cVolumeDownKey and (not cVolumeUpKey) then
       
    45     if precise then
       
    46         cVolumeDelta:= -1
       
    47     else
       
    48         cVolumeDelta:= -3
       
    49 else
       
    50     cVolumeDelta:= 0;
       
    51 end;
       
    52 
       
    53 procedure chGenCmd(var s: shortstring);
    36 procedure chGenCmd(var s: shortstring);
    54 begin
    37 begin
    55 case s[1] of
    38 case s[1] of
    56     'R': if ReadyTimeLeft > 0 then
    39     'R': if ReadyTimeLeft > 0 then
    57         begin
    40         begin
   292 end;
   275 end;
   293 
   276 
   294 procedure chPrecise_p(var s: shortstring);
   277 procedure chPrecise_p(var s: shortstring);
   295 begin
   278 begin
   296 s:= s; // avoid compiler hint
   279 s:= s; // avoid compiler hint
   297 updateVolumeDelta(true);
       
   298 if CheckNoTeamOrHH then
   280 if CheckNoTeamOrHH then
   299     exit;
   281     exit;
   300 if not isExternalSource then
   282 if not isExternalSource then
   301     SendIPC(_S'Z');
   283     SendIPC(_S'Z');
   302 bShowFinger:= false;
   284 bShowFinger:= false;
   306 end;
   288 end;
   307 
   289 
   308 procedure chPrecise_m(var s: shortstring);
   290 procedure chPrecise_m(var s: shortstring);
   309 begin
   291 begin
   310 s:= s; // avoid compiler hint
   292 s:= s; // avoid compiler hint
   311 updateVolumeDelta(false);
       
   312 if CheckNoTeamOrHH then
   293 if CheckNoTeamOrHH then
   313     exit;
   294     exit;
   314 if not isExternalSource then
   295 if not isExternalSource then
   315     SendIPC(_S'z');
   296     SendIPC(_S'z');
   316 with CurrentHedgehog^.Gear^ do
   297 with CurrentHedgehog^.Gear^ do