From 8037d33c9f429d4c0322da383cdda46776c3c14e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 21 Apr 2011 05:25:01 +0300 Subject: Impliment attack filter. Add tab in social tab. --- src/gui/widgets/avatarlistbox.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/gui/widgets/avatarlistbox.cpp') diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index c1458d3fd..8309ad156 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -114,10 +114,13 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics) if (!a) continue; - // Draw online status - Image *icon = a->getOnline() ? onlineIcon : offlineIcon; - if (icon) - graphics->drawImage(icon, 2, y + 1); + if (a->getType() != MapItem::SEPARATOR) + { + // Draw online status + Image *icon = a->getOnline() ? onlineIcon : offlineIcon; + if (icon) + graphics->drawImage(icon, 2, y + 1); + } if (a->getDisplayBold()) graphics->setFont(boldFont); @@ -316,6 +319,20 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) model->getAvatarAt(selected)->getName()); } } + else if (ava->getType() == MapItem::MONSTER) + { + if (model->getAvatarAt(selected)->getLevel() == 0) + { + viewport->showAttackMonsterPopup("", + model->getAvatarAt(selected)->getOnline()); + } + else + { + viewport->showAttackMonsterPopup( + model->getAvatarAt(selected)->getName(), + model->getAvatarAt(selected)->getOnline()); + } + } else { Map *map = viewport->getMap(); -- cgit v1.2.3-70-g09d2