From f155e142ea06262ed09720e5b7d11d1b9693f645 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 25 Mar 2015 23:17:02 +0300 Subject: eathena: show in homunculus popup intimacy and hunger counters. --- src/gui/popups/beingpopup.cpp | 23 ++++++++++++++++++++++- src/gui/viewport.cpp | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp index c124d3c62..773376cee 100644 --- a/src/gui/popups/beingpopup.cpp +++ b/src/gui/popups/beingpopup.cpp @@ -22,6 +22,7 @@ #include "gui/popups/beingpopup.h" #include "being/being.h" +#include "being/homunculusinfo.h" #include "being/petinfo.h" #include "being/playerinfo.h" #include "being/playerrelations.h" @@ -147,7 +148,8 @@ void BeingPopup::show(const int x, const int y, Being *const b) label6->setCaption(""); #ifdef EATHENA_SUPPORT - if (b->getType() == ActorType::Pet) + const ActorType::Type type = b->getType(); + if (type == ActorType::Pet) { PetInfo *const info = PlayerInfo::getPet(); if (info) @@ -166,6 +168,25 @@ void BeingPopup::show(const int x, const int y, Being *const b) label6 = nullptr; } } + else if (type == ActorType::Homunculus) + { + HomunculusInfo *const info = PlayerInfo::getHomunculus(); + 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 #endif { diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 7d18b3c1d..642d060fc 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -777,6 +777,7 @@ void Viewport::mouseMoved(MouseEvent &event) if (mHoverBeing && (type == ActorType::Player || type == ActorType::Npc + || type == ActorType::Homunculus || type == ActorType::LocalPet || type == ActorType::Pet)) { -- cgit v1.2.3-70-g09d2