diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-07-31 23:20:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-07-31 23:20:54 +0300 |
commit | 33ef923235aeabd07308816bb07ef790cc6c1024 (patch) | |
tree | e50c8bbefae98bc57e5b804ba145bca2005c5ca7 /src/gui/widgets/avatarlistbox.cpp | |
parent | b6bd4b5d68df33d12f18a67de2e54e016a0935fe (diff) | |
download | manaplus-33ef923235aeabd07308816bb07ef790cc6c1024.tar.gz manaplus-33ef923235aeabd07308816bb07ef790cc6c1024.tar.bz2 manaplus-33ef923235aeabd07308816bb07ef790cc6c1024.tar.xz manaplus-33ef923235aeabd07308816bb07ef790cc6c1024.zip |
Move popup related code from viewport into popupManager.
Diffstat (limited to 'src/gui/widgets/avatarlistbox.cpp')
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 80bcba94c..6369efce8 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -28,6 +28,7 @@ #include "being/localplayer.h" #include "gui/gui.h" +#include "gui/popupmanager.h" #include "gui/skin.h" #include "gui/viewport.h" @@ -335,7 +336,7 @@ void AvatarListBox::draw(Graphics *graphics) void AvatarListBox::mousePressed(MouseEvent &event) { - if (!actorManager || !localPlayer || !viewport + if (!actorManager || !localPlayer || !popupManager || !getFont()->getHeight()) { return; @@ -385,9 +386,9 @@ void AvatarListBox::mousePressed(MouseEvent &event) const Being *const being = actorManager->findBeingByName( avatar->getName(), ActorType::PLAYER); if (being) - viewport->showPopup(being); + popupManager->showPopup(being); else - viewport->showPlayerPopup(avatar->getName()); + popupManager->showPlayerPopup(avatar->getName()); } break; } @@ -401,7 +402,7 @@ void AvatarListBox::mousePressed(MouseEvent &event) else name = model->getAvatarAt(selected)->getName(); - viewport->showAttackMonsterPopup(name, + popupManager->showAttackMonsterPopup(name, model->getAvatarAt(selected)->getType()); break; } @@ -414,7 +415,7 @@ void AvatarListBox::mousePressed(MouseEvent &event) else name = model->getAvatarAt(selected)->getName(); - viewport->showPickupItemPopup(name); + popupManager->showPickupItemPopup(name); break; } default: @@ -425,7 +426,7 @@ void AvatarListBox::mousePressed(MouseEvent &event) { MapItem *const mapItem = map->findPortalXY( ava->getX(), ava->getY()); - viewport->showPopup(mapItem); + popupManager->showPopup(mapItem); } break; } |