# HG changeset patch # User koda # Date 1309786544 -7200 # Node ID 1840da0c1f1df50dad760b4401b8571311620644 # Parent f41e87de8989027a7a0c587d771d8823495d8e17 little code cleanup (but please test) diff -r f41e87de8989 -r 1840da0c1f1d hedgewars/uChat.pas --- a/hedgewars/uChat.pas Mon Jul 04 12:28:58 2011 +0200 +++ b/hedgewars/uChat.pas Mon Jul 04 15:35:44 2011 +0200 @@ -51,12 +51,13 @@ ChatReady: boolean; showAll: boolean; -const colors: array[#1..#5] of TSDL_Color = ( +const colors: array[#1..#6] of TSDL_Color = ( (r:$FF; g:$FF; b:$FF; unused:$FF), // chat message [White] (r:$FF; g:$00; b:$FF; unused:$FF), // action message [Purple] (r:$90; g:$FF; b:$90; unused:$FF), // join/leave message [Lime] (r:$FF; g:$FF; b:$A0; unused:$FF), // team message [Light Yellow] - (r:$FF; g:$00; b:$00; unused:$ff) // error messages [Red] + (r:$FF; g:$00; b:$00; unused:$FF), // error messages [Red] + (r:$00; g:$FF; b:$FF; unused:$FF) // input line [Light Blue] ); procedure SetLine(var cl: TChatLine; str: shortstring; isInput: boolean); @@ -72,11 +73,7 @@ if isInput then begin - // [Light Blue] - color.r:= $00; - color.g:= $FF; - color.b:= $FF; - color.unused:= $FF; + color:= colors[#6]; str:= UserNick + '> ' + str + '_' end else @@ -153,14 +150,9 @@ dec(r.y, 16); -while - ( - ((t < 7) and (Strs[i].Time > RealTicks)) - or - ((t < MaxStrIndex) and showAll) - ) - and - (Strs[i].Tex <> nil) do +while (((t < 7) and (Strs[i].Time > RealTicks)) or + ((t < MaxStrIndex) and showAll)) and + (Strs[i].Tex <> nil) do begin r.w:= Strs[i].Width; DrawFillRect(r);