diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-19 18:29:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-19 18:29:03 +0300 |
commit | 7b6b389fe156b8ff1fc1f35ee776a2e65f160921 (patch) | |
tree | 81e893b9e57ff483492df3dd4b645157a02173b3 /src/gui/widgets | |
parent | f3fdd048e6265ab2c6e88ddff21dffd9409c03db (diff) | |
download | mv-7b6b389fe156b8ff1fc1f35ee776a2e65f160921.tar.gz mv-7b6b389fe156b8ff1fc1f35ee776a2e65f160921.tar.bz2 mv-7b6b389fe156b8ff1fc1f35ee776a2e65f160921.tar.xz mv-7b6b389fe156b8ff1fc1f35ee776a2e65f160921.zip |
Move mapitemtype into separate file.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 19 | ||||
-rw-r--r-- | src/gui/widgets/tabs/socialtabbase.h | 6 |
2 files changed, 14 insertions, 11 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 4bbc85a94..41a190daa 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -38,6 +38,7 @@ #include "gui/windows/chatwindow.h" #include "resources/image.h" +#include "resources/mapitemtype.h" #include "resources/map/map.h" #include "resources/map/mapitem.h" @@ -128,7 +129,7 @@ void AvatarListBox::draw(Graphics *graphics) if (!a) continue; - if (a->getType() != MapItem::SEPARATOR) + if (a->getType() != MapItemType::SEPARATOR) { // Draw online status const Image *const icon = a->getOnline() @@ -286,7 +287,7 @@ void AvatarListBox::draw(Graphics *graphics) // Draw Name if (a->getDisplayBold()) { - if (a->getType() == MapItem::SEPARATOR) + if (a->getType() == MapItemType::SEPARATOR) { boldFont->drawString(graphics, text, mImagePadding + mPadding, y + mPadding); @@ -299,7 +300,7 @@ void AvatarListBox::draw(Graphics *graphics) } else { - if (a->getType() == MapItem::SEPARATOR) + if (a->getType() == MapItemType::SEPARATOR) { font->drawString(graphics, text, mImagePadding + mPadding, y + mPadding); @@ -363,7 +364,7 @@ void AvatarListBox::mousePressed(MouseEvent &event) switch (ava->getType()) { // AVATAR_PLAYER - case MapItem::EMPTY: + case MapItemType::EMPTY: { const Avatar *const avatar = model->getAvatarAt(selected); if (avatar) @@ -377,9 +378,9 @@ void AvatarListBox::mousePressed(MouseEvent &event) } break; } - case MapItem::ATTACK: - case MapItem::PRIORITY: - case MapItem::IGNORE_: + case MapItemType::ATTACK: + case MapItemType::PRIORITY: + case MapItemType::IGNORE_: { std::string name; if (model->getAvatarAt(selected)->getLevel() == 0) @@ -391,8 +392,8 @@ void AvatarListBox::mousePressed(MouseEvent &event) model->getAvatarAt(selected)->getType()); break; } - case MapItem::PICKUP: - case MapItem::NOPICKUP: + case MapItemType::PICKUP: + case MapItemType::NOPICKUP: { std::string name; if (model->getAvatarAt(selected)->getLevel() == 0) diff --git a/src/gui/widgets/tabs/socialtabbase.h b/src/gui/widgets/tabs/socialtabbase.h index 6a64ad9f0..d15f39a6c 100644 --- a/src/gui/widgets/tabs/socialtabbase.h +++ b/src/gui/widgets/tabs/socialtabbase.h @@ -23,6 +23,8 @@ #include "actormanager.h" +#include "resources/mapitemtype.h" + #include "resources/map/mapitem.h" #define addAvatars(mob, str, type) \ @@ -30,7 +32,7 @@ ava = new Avatar(str);\ ava->setOnline(false);\ ava->setLevel(-1);\ - ava->setType(MapItem::SEPARATOR);\ + ava->setType(MapItemType::SEPARATOR);\ ava->setX(0);\ ava->setY(0);\ avatars->push_back(ava);\ @@ -53,7 +55,7 @@ ava = new Avatar(name);\ ava->setOnline(true);\ ava->setLevel(level);\ - ava->setType(MapItem::type);\ + ava->setType(MapItemType::type);\ ava->setX(0);\ ava->setY(0);\ avatars->push_back(ava);\ |