mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 10:53:51 +00:00
Use localized faction name when using TFH
This commit is contained in:
parent
f0b73e0a27
commit
f75f9cb337
1 changed files with 11 additions and 8 deletions
|
@ -652,19 +652,22 @@ namespace MWGui
|
|||
std::string ret;
|
||||
ret += getMiscString(cellref.getOwner(), "Owner");
|
||||
const std::string factionId = cellref.getFaction();
|
||||
ret += getMiscString(factionId, "Faction");
|
||||
if (!factionId.empty() && cellref.getFactionRank() >= 0)
|
||||
if (!factionId.empty())
|
||||
{
|
||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::Faction *fact = store.get<ESM::Faction>().search(factionId);
|
||||
if (fact != nullptr)
|
||||
{
|
||||
int rank = cellref.getFactionRank();
|
||||
const std::string rankName = fact->mRanks[rank];
|
||||
if (rankName.empty())
|
||||
ret += getValueString(cellref.getFactionRank(), "Rank");
|
||||
else
|
||||
ret += getMiscString(rankName, "Rank");
|
||||
ret += getMiscString(fact->mName.empty() ? factionId : fact->mName, "Owner Faction");
|
||||
if (cellref.getFactionRank() >= 0)
|
||||
{
|
||||
int rank = cellref.getFactionRank();
|
||||
const std::string rankName = fact->mRanks[rank];
|
||||
if (rankName.empty())
|
||||
ret += getValueString(cellref.getFactionRank(), "Rank");
|
||||
else
|
||||
ret += getMiscString(rankName, "Rank");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue