hedgewars/uChat.pas
changeset 13077 c213645ff848
parent 12846 e5c461729fe3
child 13385 ec1491bb5acc
child 13457 b587cdb03bac
equal deleted inserted replaced
13076:65a3b4bea459 13077:c213645ff848
   301 // draw chat lines with some distance from screen border
   301 // draw chat lines with some distance from screen border
   302 left:= 4 - cScreenWidth div 2;
   302 left:= 4 - cScreenWidth div 2;
   303 top := 10 + visibleCount * ClHeight; // we start with input line (if any)
   303 top := 10 + visibleCount * ClHeight; // we start with input line (if any)
   304 
   304 
   305 // draw chat input line first and under all other lines
   305 // draw chat input line first and under all other lines
   306 if (GameState = gsChat) and (InputStr.Tex <> nil) then
   306 if isInChatMode and (InputStr.Tex <> nil) then
   307     begin
   307     begin
   308 
   308 
   309     if InputLinePrefix.Tex = nil then
   309     if InputLinePrefix.Tex = nil then
   310         RenderChatLineTex(InputLinePrefix, InputLinePrefix.s);
   310         RenderChatLineTex(InputLinePrefix, InputLinePrefix.s);
   311 
   311 
   573 begin
   573 begin
   574     FreezeEnterKey;
   574     FreezeEnterKey;
   575     history:= 0;
   575     history:= 0;
   576     SDL_StopTextInput();
   576     SDL_StopTextInput();
   577     //SDL_EnableKeyRepeat(0,0);
   577     //SDL_EnableKeyRepeat(0,0);
   578     GameState:= gsGame;
   578     isInChatMode:= false;
   579     ResetKbd;
   579     ResetKbd;
   580 end;
   580 end;
   581 
   581 
   582 procedure DelBytesFromInputStrBack(endIdx: integer; count: byte);
   582 procedure DelBytesFromInputStrBack(endIdx: integer; count: byte);
   583 var startIdx: integer;
   583 var startIdx: integer;
  1099 
  1099 
  1100 procedure chChat(var s: shortstring);
  1100 procedure chChat(var s: shortstring);
  1101 var i: Integer;
  1101 var i: Integer;
  1102 begin
  1102 begin
  1103     s:= s; // avoid compiler hint
  1103     s:= s; // avoid compiler hint
  1104     GameState:= gsChat;
  1104     isInChatMode:= true;
  1105     SDL_StopTextInput();
  1105     SDL_StopTextInput();
  1106     SDL_StartTextInput();
  1106     SDL_StartTextInput();
  1107     //Make REALLY sure unexpected events are flushed (1 time is insufficient as of SDL 2.0.7)
  1107     //Make REALLY sure unexpected events are flushed (1 time is insufficient as of SDL 2.0.7)
  1108     for i := 1 to 2 do
  1108     for i := 1 to 2 do
  1109     begin
  1109     begin