diff -r b812bfcfeb49 -r ef4288298e57 hedgewars/uChat.pas --- a/hedgewars/uChat.pas Mon Nov 14 23:46:23 2011 +0200 +++ b/hedgewars/uChat.pas Mon Nov 14 17:56:44 2011 -0500 @@ -24,6 +24,7 @@ procedure initModule; procedure freeModule; +procedure ReloadLines; procedure AddChatString(s: shortstring); procedure DrawChat; @@ -72,15 +73,15 @@ cl.s:= str; if isInput then -begin + begin color:= colors[#6]; str:= UserNick + '> ' + str + '_' -end + end else -begin + begin color:= colors[str[1]]; delete(str, 1, 1) -end; + end; font:= CheckCJKFont(str, fnt16); w:= 0; h:= 0; // avoid compiler hints @@ -99,6 +100,14 @@ SDL_FreeSurface(resSurface) end; +// For uStore texture recreation +procedure ReloadLines; +var i: LongWord; +begin + SetLine(InputStr, InputStr.s, true); + for i:= 0 to MaxStrIndex do SetLine(Strs[i], Strs[i].s, false) +end; + procedure AddChatString(s: shortstring); begin if not ChatReady then @@ -370,20 +379,14 @@ missedCount:= 0; inputStr.Tex := nil; - for i:= 0 to MaxStrIndex do - begin - Strs[i].Tex := nil; - end; + for i:= 0 to MaxStrIndex do Strs[i].Tex := nil; end; procedure freeModule; var i: ShortInt; begin FreeTexture(InputStr.Tex); - for i:= 0 to MaxStrIndex do - begin - FreeTexture(Strs[i].Tex); - end; + for i:= 0 to MaxStrIndex do FreeTexture(Strs[i].Tex); end; end.