summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-04-24 17:52:59 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-04-24 17:52:59 +0000
commita0a5ec6ba51aed9544fe5fc77d58c0f13f5eea4e (patch)
treeaf4cab5822fe36b48118778dcd746864c4a2543d /src
parent581b56ac21c46a39615f6375cd7e622b928f2464 (diff)
downloadmana-client-a0a5ec6ba51aed9544fe5fc77d58c0f13f5eea4e.tar.gz
mana-client-a0a5ec6ba51aed9544fe5fc77d58c0f13f5eea4e.tar.bz2
mana-client-a0a5ec6ba51aed9544fe5fc77d58c0f13f5eea4e.tar.xz
mana-client-a0a5ec6ba51aed9544fe5fc77d58c0f13f5eea4e.zip
Fixed long nicknames to be clipped to name area, and cleaned up change log.
Diffstat (limited to 'src')
-rw-r--r--src/gui/chat.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 71cdd25a..b7051a3b 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -144,26 +144,41 @@ void ChatWindow::draw(gcn::Graphics *graphics)
getAbsolutePosition(x, y);
- for (iter = chatlog.begin(); iter != chatlog.end(); iter++) {
+ for (iter = chatlog.begin(); iter != chatlog.end(); iter++)
+ {
line = *iter;
+
texty -= getFont()->getHeight() - 2;
+ graphics->pushClipArea(gcn::Rectangle(0, 0, 95, getHeight()));
+
switch (line.own) {
case BY_GM:
graphics->setColor(gcn::Color(97, 156, 236)); // GM Bue
graphics->drawText("Global announcement: ", 5, texty);
- graphics->setColor(gcn::Color(39, 197, 39)); // Green
- graphics->drawText(line.text, 100, texty);
break;
case BY_PLAYER:
graphics->setColor(gcn::Color(255, 246, 98)); // Yellow
graphics->drawText(line.nick, 5, texty);
- graphics->setColor(gcn::Color(255, 255, 255)); // White
- graphics->drawText(line.text, 100, texty);
break;
case BY_OTHER:
graphics->setColor(gcn::Color(97, 156, 236)); // GM Bue
graphics->drawText(line.nick, 5, texty);
+ break;
+ }
+
+ graphics->popClipArea();
+
+ switch (line.own) {
+ case BY_GM:
+ graphics->setColor(gcn::Color(39, 197, 39)); // Green
+ graphics->drawText(line.text, 100, texty);
+ break;
+ case BY_PLAYER:
+ graphics->setColor(gcn::Color(255, 255, 255)); // White
+ graphics->drawText(line.text, 100, texty);
+ break;
+ case BY_OTHER:
graphics->setColor(gcn::Color(39, 197, 39)); // Green
graphics->drawText(line.text, 100, texty);
break;