1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-28 20:06:41 +00:00

Return the appropriate name for werewolf NPCs

This commit is contained in:
Chris Robinson 2013-08-08 03:57:32 -07:00
parent dfdd2dc308
commit 946ca7f931

View file

@ -290,9 +290,15 @@ namespace MWClass
std::string Npc::getName (const MWWorld::Ptr& ptr) const std::string Npc::getName (const MWWorld::Ptr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::NPC> *ref = if(getNpcStats(ptr).isWerewolf())
ptr.get<ESM::NPC>(); {
const MWBase::World *world = MWBase::Environment::get().getWorld();
const MWWorld::Store<ESM::GameSetting> &gmst = world->getStore().get<ESM::GameSetting>();
return gmst.find("sWerewolfPopup")->getString();
}
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
return ref->mBase->mName; return ref->mBase->mName;
} }
@ -795,16 +801,21 @@ namespace MWClass
MWGui::ToolTipInfo Npc::getToolTipInfo (const MWWorld::Ptr& ptr) const MWGui::ToolTipInfo Npc::getToolTipInfo (const MWWorld::Ptr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::NPC> *ref = MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
ptr.get<ESM::NPC>();
bool fullHelp = MWBase::Environment::get().getWindowManager()->getFullHelp();
MWGui::ToolTipInfo info; MWGui::ToolTipInfo info;
info.caption = ref->mBase->mName;
std::string text; info.caption = getName(ptr);
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) if(fullHelp && getNpcStats(ptr).isWerewolf())
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script"); {
info.text = text; info.caption += " (";
info.caption += ref->mBase->mName;
info.caption += ")";
}
if(fullHelp)
info.text = MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
return info; return info;
} }