summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-24 19:20:15 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-24 19:20:15 +0300
commitca69cb53048d23bacb7f57988086469b1044b365 (patch)
treef962fbed8c3ebf36545045e080828d32b4af5ca7
parent82df40f813bf90fd93bbff3aaf8cdb8a92473d27 (diff)
downloadmanaplus-ca69cb53048d23bacb7f57988086469b1044b365.tar.gz
manaplus-ca69cb53048d23bacb7f57988086469b1044b365.tar.bz2
manaplus-ca69cb53048d23bacb7f57988086469b1044b365.tar.xz
manaplus-ca69cb53048d23bacb7f57988086469b1044b365.zip
eathena: show in pet popup intimacy and hunger counters.
-rw-r--r--src/gui/popups/beingpopup.cpp176
-rw-r--r--src/gui/viewport.cpp3
2 files changed, 103 insertions, 76 deletions
diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp
index f2e2b723a..c743a99a5 100644
--- a/src/gui/popups/beingpopup.cpp
+++ b/src/gui/popups/beingpopup.cpp
@@ -22,6 +22,8 @@
#include "gui/popups/beingpopup.h"
#include "being/being.h"
+#include "being/petinfo.h"
+#include "being/playerinfo.h"
#include "being/playerrelations.h"
#include "gui/gui.h"
@@ -116,6 +118,7 @@ void BeingPopup::show(const int x, const int y, Being *const b)
}
mBeingName->setCaption(b->getName() + b->getGenderSignWithSpace());
+ logger->log("being name: " + b->getName());
if (gui)
{
if (player_relations.isGoodName(b))
@@ -143,90 +146,113 @@ void BeingPopup::show(const int x, const int y, Being *const b)
label5->setCaption("");
label6->setCaption("");
- if (!(b->getPartyName().empty()))
+ if (b->getType() == ActorType::Pet)
{
- // TRANSLATORS: being popup label
- label1->setCaption(strprintf(_("Party: %s"),
- b->getPartyName().c_str()));
- label1->adjustSize();
+ PetInfo *const info = PlayerInfo::getPet();
+ if (info)
+ {
+ // TRANSLATORS: being popup label
+ label1->setCaption(strprintf(_("Hungry: %d"),
+ info->hungry));
+ label1->adjustSize();
+ // TRANSLATORS: being popup label
+ label2->setCaption(strprintf(_("Intimacy: %d"),
+ info->intimacy));
+ label2->adjustSize();
+ label3 = nullptr;
+ label4 = nullptr;
+ label5 = nullptr;
+ label6 = nullptr;
+ }
}
else
{
- label6 = label4;
- label5 = label4;
- label4 = label3;
- label3 = label2;
- label2 = label1;
- label1 = nullptr;
- }
+ if (!(b->getPartyName().empty()))
+ {
+ // TRANSLATORS: being popup label
+ label1->setCaption(strprintf(_("Party: %s"),
+ b->getPartyName().c_str()));
+ label1->adjustSize();
+ }
+ else
+ {
+ label6 = label4;
+ label5 = label4;
+ label4 = label3;
+ label3 = label2;
+ label2 = label1;
+ label1 = nullptr;
+ }
- if (!(b->getGuildName().empty()))
- {
- // TRANSLATORS: being popup label
- label2->setCaption(strprintf(_("Guild: %s"),
- b->getGuildName().c_str()));
- label2->adjustSize();
- }
- else
- {
- label6 = label4;
- label5 = label4;
- label4 = label3;
- label3 = label2;
- label2 = nullptr;
- }
+ if (!(b->getGuildName().empty()))
+ {
+ // TRANSLATORS: being popup label
+ label2->setCaption(strprintf(_("Guild: %s"),
+ b->getGuildName().c_str()));
+ label2->adjustSize();
+ }
+ else
+ {
+ label6 = label4;
+ label5 = label4;
+ label4 = label3;
+ label3 = label2;
+ label2 = nullptr;
+ }
- if (b->getPvpRank() > 0)
- {
- // TRANSLATORS: being popup label
- label3->setCaption(strprintf(_("Pvp rank: %u"), b->getPvpRank()));
- label3->adjustSize();
- }
- else
- {
- label6 = label4;
- label5 = label4;
- label4 = label3;
- label3 = nullptr;
- }
+ if (b->getPvpRank() > 0)
+ {
+ // TRANSLATORS: being popup label
+ label3->setCaption(strprintf(_("Pvp rank: %u"),
+ b->getPvpRank()));
+ label3->adjustSize();
+ }
+ else
+ {
+ label6 = label4;
+ label5 = label4;
+ label4 = label3;
+ label3 = nullptr;
+ }
- if (!b->getBuyBoard().empty())
- {
- // TRANSLATORS: being popup label
- label4->setCaption(strprintf(_("Buy shop: %s"),
- b->getBuyBoard().c_str()));
- label4->adjustSize();
- }
- else
- {
- label6 = label4;
- label5 = label4;
- label4 = nullptr;
- }
+ if (!b->getBuyBoard().empty())
+ {
+ // TRANSLATORS: being popup label
+ label4->setCaption(strprintf(_("Buy shop: %s"),
+ b->getBuyBoard().c_str()));
+ label4->adjustSize();
+ }
+ else
+ {
+ label6 = label4;
+ label5 = label4;
+ label4 = nullptr;
+ }
- if (!b->getSellBoard().empty())
- {
- // TRANSLATORS: being popup label
- label5->setCaption(strprintf(_("Sell shop: %s"),
- b->getSellBoard().c_str()));
- label5->adjustSize();
- }
- else
- {
- label6 = label5;
- label5 = nullptr;
- }
+ if (!b->getSellBoard().empty())
+ {
+ // TRANSLATORS: being popup label
+ label5->setCaption(strprintf(_("Sell shop: %s"),
+ b->getSellBoard().c_str()));
+ label5->adjustSize();
+ }
+ else
+ {
+ label6 = label5;
+ label5 = nullptr;
+ }
- if (!b->getComment().empty())
- {
- // TRANSLATORS: being popup label
- label6->setCaption(strprintf(_("Comment: %s"),
- b->getComment().c_str()));
- label6->adjustSize();
- }
- else
- {
- label6 = nullptr;
+ if (!b->getComment().empty())
+ {
+ // TRANSLATORS: being popup label
+ label6->setCaption(strprintf(_("Comment: %s"),
+ b->getComment().c_str()));
+ label6->adjustSize();
+ }
+ else
+ {
+ label6 = nullptr;
+ }
}
int minWidth = mBeingName->getWidth();
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index fa29590f4..7d18b3c1d 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -777,7 +777,8 @@ void Viewport::mouseMoved(MouseEvent &event)
if (mHoverBeing
&& (type == ActorType::Player
|| type == ActorType::Npc
- || type == ActorType::LocalPet))
+ || type == ActorType::LocalPet
+ || type == ActorType::Pet))
{
popupManager->hideTextPopup();
if (mShowBeingPopup && beingPopup)