diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-04 20:05:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-04 20:05:48 +0300 |
commit | 62ec17f6e489ec50f17219444468aeb8969dc961 (patch) | |
tree | 350d7edb5c26c282a4e1906544536d68831228ac /src/gui/minimap.cpp | |
parent | 71d924d7dcdac067f02a317e9353ee067dbd0bde (diff) | |
parent | fd484fc70fca32ff9065b91c175089b65aa3fd26 (diff) | |
download | manaplus-62ec17f6e489ec50f17219444468aeb8969dc961.tar.gz manaplus-62ec17f6e489ec50f17219444468aeb8969dc961.tar.bz2 manaplus-62ec17f6e489ec50f17219444468aeb8969dc961.tar.xz manaplus-62ec17f6e489ec50f17219444468aeb8969dc961.zip |
Merge branch 'master' into strippedstripped1.1.9.4
Conflicts:
data/fonts/mplus-1p-bold.ttf
data/fonts/mplus-1p-regular.ttf
src/guichan/basiccontainer.cpp
src/guichan/include/guichan/basiccontainer.hpp
src/guichan/widgets/window.cpp
Diffstat (limited to 'src/gui/minimap.cpp')
-rw-r--r-- | src/gui/minimap.cpp | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index c735eec82..c3a4417f6 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -29,6 +29,7 @@ #include "localplayer.h" #include "logger.h" #include "map.h" +#include "party.h" #include "gui/userpalette.h" #include "gui/setup.h" @@ -275,9 +276,10 @@ void Minimap::draw(gcn::Graphics *graphics) { type = UserPalette::GM; } - else if (being->isInParty()) + else if (being->getGuild() == player_node->getGuild() + || being->getGuildName() == player_node->getGuildName()) { - type = UserPalette::PARTY; + type = UserPalette::GUILD; } else if (being) { @@ -317,6 +319,49 @@ void Minimap::draw(gcn::Graphics *graphics) dotSize, dotSize)); } + if (player_node->isInParty()) + { + Party *party = player_node->getParty(); + if (party) + { + PartyMember *m = party->getMember(player_node->getName()); + Party::MemberList *members = party->getMembers(); + if (m && members) + { + const std::string curMap = m->getMap(); + Party::MemberList::const_iterator it = members->begin(); + const Party::MemberList::const_iterator + it_end = members->end(); + while (it != it_end) + { + PartyMember *member = *it; + if (member && member->getMap() == curMap + && member->getOnline() && member != m) + { + if (userPalette) + { + graphics->setColor(userPalette->getColor( + UserPalette::PARTY)); + } + + const int offsetHeight = static_cast<int>( + mHeightProportion); + const int offsetWidth = static_cast<int>( + mWidthProportion); + + graphics->fillRectangle(gcn::Rectangle( + static_cast<int>(member->getX() + * mWidthProportion) + mapOriginX - offsetWidth, + static_cast<int>(member->getY() + * mHeightProportion) + mapOriginY - offsetHeight, + 2, 2)); + } + ++ it; + } + } + } + } + const Vector &pos = player_node->getPosition(); // logger->log("width:" + toString(graph->getWidth())); |