hedgewars/uChat.pas
changeset 10513 58fa783e0cfd
parent 10396 77ff1db6d6e4
child 10514 a1423588a4e4
equal deleted inserted replaced
10512:25021aac078e 10513:58fa783e0cfd
   266 var i: TWave;
   266 var i: TWave;
   267     j: TChatCmd;
   267     j: TChatCmd;
   268     c, t: LongInt;
   268     c, t: LongInt;
   269     x: byte;
   269     x: byte;
   270 begin
   270 begin
       
   271 if s <> LocalStrs[localLastStr] then
       
   272     begin
       
   273     // put in input history
       
   274     localLastStr:= (localLastStr + 1) mod MaxStrIndex;
       
   275     LocalStrs[localLastStr]:= s;
       
   276     end;
       
   277 
   271 t:= LocalTeam;
   278 t:= LocalTeam;
   272 x:= 0;
   279 x:= 0;
   273 if (s[1] = '"') and (s[Length(s)] = '"')
   280 if (s[1] = '"') and (s[Length(s)] = '"')
   274     then x:= 1
   281     then x:= 1
   275 
   282 
   293     exit
   300     exit
   294     end;
   301     end;
   295 
   302 
   296 if (s[1] = '/') then
   303 if (s[1] = '/') then
   297     begin
   304     begin
   298     // put in input history
       
   299     localLastStr:= (localLastStr + 1) mod MaxStrIndex;
       
   300     LocalStrs[localLastStr]:= s;
       
   301 
       
   302     // These 3 are same as above, only are to make the hedgehog say it on next attack
   305     // These 3 are same as above, only are to make the hedgehog say it on next attack
   303     if (copy(s, 2, 4) = 'hsa ') then
   306     if (copy(s, 2, 4) = 'hsa ') then
   304         begin
   307         begin
   305         if CurrentTeam^.ExtDriven then
   308         if CurrentTeam^.ExtDriven then
   306             ParseCommand('/say ' + copy(s, 6, Length(s)-5), true)
   309             ParseCommand('/say ' + copy(s, 6, Length(s)-5), true)
   496     SendIPC('s' + s);
   499     SendIPC('s' + s);
   497 
   500 
   498     if copy(s, 1, 4) = '/me ' then
   501     if copy(s, 1, 4) = '/me ' then
   499         s:= #2 + '* ' + UserNick + ' ' + copy(s, 5, Length(s) - 4)
   502         s:= #2 + '* ' + UserNick + ' ' + copy(s, 5, Length(s) - 4)
   500     else
   503     else
   501         begin
       
   502         localLastStr:= (localLastStr + 1) mod MaxStrIndex;
       
   503         LocalStrs[localLastStr]:= s;
       
   504         s:= #1 + UserNick + ': ' + s;
   504         s:= #1 + UserNick + ': ' + s;
   505         end;
       
   506 
   505 
   507     AddChatString(s)
   506     AddChatString(s)
   508 end;
   507 end;
   509 
   508 
   510 procedure chTeamSay(var s: shortstring);
   509 procedure chTeamSay(var s: shortstring);