about summary refs log tree commit diff
path: root/src/game/client/components/chat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/client/components/chat.cpp')
-rw-r--r--src/game/client/components/chat.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp
index 21fa0e00..4429837b 100644
--- a/src/game/client/components/chat.cpp
+++ b/src/game/client/components/chat.cpp
@@ -9,6 +9,7 @@
 
 #include <game/client/gameclient.h>
 
+#include <game/client/components/scoreboard.h>
 #include <game/client/components/sounds.h>
 #include <game/localization.h>
 
@@ -205,9 +206,10 @@ void CChat::OnRender()
 
 	y -= 8.0f;
 
-	int i;
 	int64 Now = time_get();
-	for(i = 0; i < MAX_LINES; i++)
+	float LineWidth = m_pClient->m_pScoreboard->Active() ? 95.0f : 200.0f;

+	float HeightLimit = m_pClient->m_pScoreboard->Active() ? 220.0f : m_Show ? 50.0f : 200.0f;

+	for(int i = 0; i < MAX_LINES; i++)
 	{
 		int r = ((m_CurrentLine-i)+MAX_LINES)%MAX_LINES;
 		if(Now > m_aLines[r].m_Time+15*time_freq() && !m_Show)
@@ -219,19 +221,18 @@ void CChat::OnRender()
 		// get the y offset
 		CTextCursor Cursor;
 		TextRender()->SetCursor(&Cursor, Begin, 0, FontSize, 0);
-		Cursor.m_LineWidth = 200.0f;
+		Cursor.m_LineWidth = LineWidth;
 		TextRender()->TextEx(&Cursor, m_aLines[r].m_aName, -1);
 		TextRender()->TextEx(&Cursor, m_aLines[r].m_aText, -1);
 		y -= Cursor.m_Y + Cursor.m_FontSize;
 
 		// cut off if msgs waste too much space
-		float HeightLimit = m_Show ? 0.0f : 200.0f;
 		if(y < HeightLimit)
 			break;
 		
 		// reset the cursor
 		TextRender()->SetCursor(&Cursor, Begin, y, FontSize, TEXTFLAG_RENDER);
-		Cursor.m_LineWidth = 200.0f;
+		Cursor.m_LineWidth = LineWidth;
 
 		// render name
 		TextRender()->TextColor(0.8f,0.8f,0.8f,1);