about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlfred Eriksson <somerunce@gmail.com>2008-09-07 08:44:30 +0000
committerAlfred Eriksson <somerunce@gmail.com>2008-09-07 08:44:30 +0000
commit777e685a2467c7b1b3b3c6f3626048d71a41690b (patch)
tree7a35a117e84b28d00fad5a7e25024af44673dd13
parentc3ff86330f6baa479a4d1ef79f1fd906b2a1a4a2 (diff)
downloadzcatch-777e685a2467c7b1b3b3c6f3626048d71a41690b.tar.gz
zcatch-777e685a2467c7b1b3b3c6f3626048d71a41690b.zip
merge from 0.4.3: chat placement/width
-rw-r--r--src/game/client/components/chat.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp
index 27defd24..abd2f73a 100644
--- a/src/game/client/components/chat.cpp
+++ b/src/game/client/components/chat.cpp
@@ -131,13 +131,13 @@ void CHAT::on_render()
 {
 	gfx_mapscreen(0,0,300*gfx_screenaspect(),300);
 	float x = 10.0f;
-	float y = 300.0f-30.0f;
+	float y = 300.0f-20.0f;
 	if(mode != MODE_NONE)
 	{
 		// render chat input
 		TEXT_CURSOR cursor;
 		gfx_text_set_cursor(&cursor, x, y, 8.0f, TEXTFLAG_RENDER);
-		cursor.line_width = 300.0f;
+		cursor.line_width = 200.0f;
 		
 		if(mode == MODE_ALL)
 			gfx_text_ex(&cursor, "All: ", -1);
@@ -162,7 +162,7 @@ void CHAT::on_render()
 			break;
 
 		float begin = x;
-		float fontsize = 8.0f;
+		float fontsize = 7.0f;
 		
 		// get the y offset
 		TEXT_CURSOR cursor;
@@ -172,9 +172,13 @@ void CHAT::on_render()
 		gfx_text_ex(&cursor, lines[r].text, -1);
 		y -= cursor.y + cursor.font_size;
 
+		// cut off if msgs waste too much space
+		if(y < 200.0f)
+			break;
+		
 		// reset the cursor
 		gfx_text_set_cursor(&cursor, begin, y, fontsize, TEXTFLAG_RENDER);
-		cursor.line_width = 300.0f;
+		cursor.line_width = 200.0f;
 
 		// render name
 		gfx_text_color(0.8f,0.8f,0.8f,1);