hedgewars/uChat.pas
changeset 13674 3f6fae745f84
parent 13458 32032120435c
child 13742 cb2857f55130
equal deleted inserted replaced
13673:1aa5e884326a 13674:3f6fae745f84
    33 procedure SendHogSpeech(s: shortstring);
    33 procedure SendHogSpeech(s: shortstring);
    34 procedure CopyToClipboard(var newContent: shortstring);
    34 procedure CopyToClipboard(var newContent: shortstring);
    35 procedure TextInput(var event: TSDL_TextInputEvent);
    35 procedure TextInput(var event: TSDL_TextInputEvent);
    36 
    36 
    37 implementation
    37 implementation
    38 uses uInputHandler, uTypes, uVariables, uCommands, uUtils, uTextures, uRender, uIO, uScript, uRenderUtils;
    38 uses uInputHandler, uTypes, uVariables, uCommands, uUtils, uTextures, uRender, uIO, uScript, uRenderUtils, uLocale;
    39 
    39 
    40 const MaxStrIndex = 27;
    40 const MaxStrIndex = 27;
    41       MaxInputStrLen = 200;
    41       MaxInputStrLen = 200;
    42 
    42 
    43 type TChatLine = record
    43 type TChatLine = record
  1111     SendIPC('s' + s);
  1111     SendIPC('s' + s);
  1112 
  1112 
  1113     if copy(s, 1, 4) = '/me ' then
  1113     if copy(s, 1, 4) = '/me ' then
  1114         s:= #2 + '* ' + UserNick + ' ' + copy(s, 5, Length(s) - 4)
  1114         s:= #2 + '* ' + UserNick + ' ' + copy(s, 5, Length(s) - 4)
  1115     else
  1115     else
  1116         s:= #1 + UserNick + ': ' + s;
  1116         s:= #1 + Format(trmsg[sidChat], [UserNick, s]);
  1117 
  1117 
  1118     AddChatString(s)
  1118     AddChatString(s)
  1119 end;
  1119 end;
  1120 
  1120 
  1121 procedure chTeamSay(var s: shortstring);
  1121 procedure chTeamSay(var s: shortstring);
  1122 begin
  1122 begin
  1123     SendIPC('b' + s);
  1123     SendIPC('b' + s);
  1124 
  1124 
  1125     s:= #4 + '[Team] ' + UserNick + ': ' + s;
  1125     s:= #4 + Format(trmsg[sidChatTeam], [UserNick, s]);
  1126 
  1126 
  1127     AddChatString(s)
  1127     AddChatString(s)
  1128 end;
  1128 end;
  1129 
  1129 
  1130 procedure chHistory(var s: shortstring);
  1130 procedure chHistory(var s: shortstring);