hedgewars/uChat.pas
changeset 4925 3d90fd7f738a
parent 4920 bc3c077e15a2
child 4976 088d40d8aba2
equal deleted inserted replaced
4924:616b618814b5 4925:3d90fd7f738a
    63 var strSurface, resSurface: PSDL_Surface;
    63 var strSurface, resSurface: PSDL_Surface;
    64     w, h: LongInt;
    64     w, h: LongInt;
    65     color: TSDL_Color;
    65     color: TSDL_Color;
    66     font: THWFont;
    66     font: THWFont;
    67 begin
    67 begin
    68 // these two lines lines crash when run multiple times?
    68 if cl.Tex <> nil then
    69 //if cl.Tex <> nil then
    69     FreeTexture(cl.Tex);
    70 //    FreeTexture(cl.Tex);
       
    71 
    70 
    72 cl.s:= str;
    71 cl.s:= str;
    73 
    72 
    74 if isInput then
    73 if isInput then
    75 begin
    74 begin
   353         KeyPressChat(32)
   352         KeyPressChat(32)
   354         end
   353         end
   355 end;
   354 end;
   356 
   355 
   357 procedure initModule;
   356 procedure initModule;
       
   357 var i: ShortInt;
   358 begin
   358 begin
   359     RegisterVariable('chatmsg', vtCommand, @chChatMessage, true);
   359     RegisterVariable('chatmsg', vtCommand, @chChatMessage, true);
   360     RegisterVariable('say', vtCommand, @chSay, true);
   360     RegisterVariable('say', vtCommand, @chSay, true);
   361     RegisterVariable('team', vtCommand, @chTeamSay, true);
   361     RegisterVariable('team', vtCommand, @chTeamSay, true);
   362     RegisterVariable('history', vtCommand, @chHistory, true );
   362     RegisterVariable('history', vtCommand, @chHistory, true );
   365     lastStr:= 0;
   365     lastStr:= 0;
   366     visibleCount:= 0;
   366     visibleCount:= 0;
   367     showAll:= false;
   367     showAll:= false;
   368     ChatReady:= false;
   368     ChatReady:= false;
   369     missedCount:= 0;
   369     missedCount:= 0;
       
   370 
       
   371     inputStr.Tex := nil;
       
   372     for i:= 0 to MaxStrIndex do
       
   373     begin
       
   374         Strs[i].Tex := nil;
       
   375     end;
   370 end;
   376 end;
   371 
   377 
   372 procedure freeModule;
   378 procedure freeModule;
   373 var i: ShortInt;
   379 var i: ShortInt;
   374 begin
   380 begin