From 8f10444e4ce4a4e25455f0a3857edc7ca74631e8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 26 Apr 2011 21:56:11 +0300 Subject: Impliment 3 attack lists. (priority, attack, ignore) --- src/gui/socialwindow.cpp | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) (limited to 'src/gui/socialwindow.cpp') diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index c6ec12cd8..d25ca209d 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -808,7 +808,7 @@ public: std::vector *avatars = mBeings->getMembers(); - std::list mobs = player_node->getAttackMobs(); + std::list mobs = player_node->getPriorityAttackMobs(); std::list::iterator i = mobs.begin(); std::vector::iterator ia = avatars->begin(); @@ -820,7 +820,7 @@ public: } avatars->clear(); - Avatar *ava = new Avatar(_("Selected mobs")); + Avatar *ava = new Avatar(_("Priority mobs")); ava->setOnline(false); ava->setLevel(-1); ava->setType(MapItem::SEPARATOR); @@ -844,7 +844,42 @@ public: Avatar *ava = new Avatar(name); ava->setOnline(true); ava->setLevel(level); - ava->setType(MapItem::MONSTER); + ava->setType(MapItem::PRIORITY); + ava->setX(0); + ava->setY(0); + avatars->push_back(ava); + + ++ i; + } + + ava = new Avatar(_("Attack mobs")); + ava->setOnline(false); + ava->setLevel(-1); + ava->setType(MapItem::SEPARATOR); + ava->setX(0); + ava->setY(0); + avatars->push_back(ava); + + mobs = player_node->getAttackMobs(); + i = mobs.begin(); + + while (i != mobs.end()) + { + std::string name; + int level = -1; + if (*i == "") + { + name = _("(default)"); + level = 0; + } + else + { + name = *i; + } + Avatar *ava = new Avatar(name); + ava->setOnline(true); + ava->setLevel(level); + ava->setType(MapItem::ATTACK); ava->setX(0); ava->setY(0); avatars->push_back(ava); @@ -879,7 +914,7 @@ public: Avatar *ava = new Avatar(name); ava->setOnline(false); ava->setLevel(level); - ava->setType(MapItem::MONSTER); + ava->setType(MapItem::IGNORE); ava->setX(0); ava->setY(0); avatars->push_back(ava); -- cgit v1.2.3-60-g2f50