summaryrefslogtreecommitdiff
path: root/src/gui/beingpopup.cpp
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2010-08-20 18:09:37 +0200
committerJared Adams <jaxad0127@gmail.com>2010-08-20 10:31:02 -0600
commitdf91c40fa79629adb2652ed1b5141d943113a936 (patch)
treede7f8b0d861e2cf055ec90eeaaa39193cc837b08 /src/gui/beingpopup.cpp
parentdb0f5e2a332f82c006729146727d37315de7dfda (diff)
downloadmana-df91c40fa79629adb2652ed1b5141d943113a936.tar.gz
mana-df91c40fa79629adb2652ed1b5141d943113a936.tar.bz2
mana-df91c40fa79629adb2652ed1b5141d943113a936.tar.xz
mana-df91c40fa79629adb2652ed1b5141d943113a936.zip
Show info popups for all players
Until now popups were only shown for players who are member of a party. This resolves http://bugs.manasource.org/view.php?id=197 Signed-off-by: Jared Adams <jaxad0127@gmail.com>
Diffstat (limited to 'src/gui/beingpopup.cpp')
-rw-r--r--src/gui/beingpopup.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/gui/beingpopup.cpp b/src/gui/beingpopup.cpp
index 687b20c2..2150f7e5 100644
--- a/src/gui/beingpopup.cpp
+++ b/src/gui/beingpopup.cpp
@@ -65,25 +65,28 @@ void BeingPopup::show(int x, int y, Player *p)
return;
}
+ mBeingName->setCaption(p->getName());
+ mBeingName->adjustSize();
+
+ int minWidth = mBeingName->getWidth();
+ const int height = getFont()->getHeight();
+
if (!(p->getPartyName().empty()))
{
- mBeingName->setCaption(p->getName());
- mBeingName->adjustSize();
-
mBeingParty->setCaption(strprintf(_("Party: %s"),
p->getPartyName().c_str()));
mBeingParty->adjustSize();
- int minWidth = std::max(mBeingName->getWidth(),
- mBeingParty->getWidth());
-
- const int height = getFont()->getHeight();
+ if (minWidth < mBeingParty->getWidth())
+ minWidth = mBeingParty->getWidth();
setContentSize(minWidth + 10, (height * 2) + 10);
-
- position(x, y);
- return;
+ }
+ else
+ {
+ mBeingParty->setCaption("");
+ setContentSize(minWidth + 10, height + 10);
}
- setVisible(false);
+ position(x, y);
}