do not render chat if HUD is hidden
authorsheepluva
Sun, 10 Aug 2014 17:03:02 +0200
changeset 10375 6d6adccd0d7d
parent 10374 c7ef47665410
child 10376 e8c933a00f97
do not render chat if HUD is hidden
hedgewars/uChat.pas
--- a/hedgewars/uChat.pas	Sat Aug 02 15:11:13 2014 +0400
+++ b/hedgewars/uChat.pas	Sun Aug 10 17:03:02 2014 +0200
@@ -209,13 +209,6 @@
 var i, t, left, top, cnt: Longword;
 begin
 ChatReady:= true; // maybe move to somewhere else?
-if MissedCount <> 0 then // there are chat strings we missed, so print them now
-    begin
-    for i:= 0 to MissedCount - 1 do
-        AddChatString(MStrs[i]);
-    MissedCount:= 0;
-    end;
-i:= lastStr;
 
 left:= 4 - cScreenWidth div 2;
 top := 10;
@@ -226,27 +219,37 @@
     DrawTexture(left, top + visibleCount * ClHeight, InputStr.Tex);
     end;
 
-
-cnt:= 0; // count of lines displayed
-t  := 1; // # of current line processed
+if UIDisplay <> uiNone then
+    begin
+    if MissedCount <> 0 then // there are chat strings we missed, so print them now
+        begin
+        for i:= 0 to MissedCount - 1 do
+            AddChatString(MStrs[i]);
+        MissedCount:= 0;
+        end;
+    i:= lastStr;
 
-// draw lines in reverse order
-while (((t < 7) and (Strs[i].Time > RealTicks)) or ((t < MaxStrIndex) and showAll))
-and (Strs[i].Tex <> nil) do
-    begin
-    // draw lines 4px away from left screen border and 2px away from top
-    DrawTexture(left, top + (visibleCount - t) * ClHeight, Strs[i].Tex);
+    cnt:= 0; // count of lines displayed
+    t  := 1; // # of current line processed
 
-    if i = 0 then
-        i:= MaxStrIndex
-    else
-        dec(i);
+    // draw lines in reverse order
+    while (((t < 7) and (Strs[i].Time > RealTicks)) or ((t < MaxStrIndex) and showAll))
+    and (Strs[i].Tex <> nil) do
+        begin
+        // draw lines 4px away from left screen border and 2px away from top
+        DrawTexture(left, top + (visibleCount - t) * ClHeight, Strs[i].Tex);
 
-    inc(cnt);
-    inc(t)
+        if i = 0 then
+            i:= MaxStrIndex
+        else
+            dec(i);
+
+        inc(cnt);
+        inc(t)
+        end;
+
+    visibleCount:= cnt;
     end;
-
-visibleCount:= cnt;
 end;
 
 procedure SendHogSpeech(s: shortstring);