From 777e685a2467c7b1b3b3c6f3626048d71a41690b Mon Sep 17 00:00:00 2001 From: Alfred Eriksson Date: Sun, 7 Sep 2008 08:44:30 +0000 Subject: merge from 0.4.3: chat placement/width --- src/game/client/components/chat.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') 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); -- cgit 1.4.1