mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 03:54:40 +00:00
Merge branch 'imthefactornow' into 'master'
Don't show nameless higher ranks Closes #7923 See merge request OpenMW/openmw!4014
This commit is contained in:
commit
49b974763f
@ -223,6 +223,7 @@
|
||||
Feature #7860: Lua: Expose NPC AI settings (fight, alarm, flee)
|
||||
Feature #7875: Disable MyGUI windows snapping
|
||||
Feature #7914: Do not allow to move GUI windows out of screen
|
||||
Feature #7923: Don't show non-existent higher ranks for factions with fewer than 9 ranks
|
||||
Task #5896: Do not use deprecated MyGUI properties
|
||||
Task #6085: Replace boost::filesystem with std::filesystem
|
||||
Task #6149: Dehardcode Lua API_REVISION
|
||||
|
@ -582,9 +582,8 @@ namespace MWGui
|
||||
const std::set<ESM::RefId>& expelled = PCstats.getExpelled();
|
||||
|
||||
bool firstFaction = true;
|
||||
for (auto& factionPair : mFactions)
|
||||
for (const auto& [factionId, factionRank] : mFactions)
|
||||
{
|
||||
const ESM::RefId& factionId = factionPair.first;
|
||||
const ESM::Faction* faction = store.get<ESM::Faction>().find(factionId);
|
||||
if (faction->mData.mIsHidden == 1)
|
||||
continue;
|
||||
@ -611,10 +610,10 @@ namespace MWGui
|
||||
text += "\n#{fontcolourhtml=normal}#{sExpelled}";
|
||||
else
|
||||
{
|
||||
const int rank = std::clamp(factionPair.second, 0, 9);
|
||||
text += std::string("\n#{fontcolourhtml=normal}") + faction->mRanks[rank];
|
||||
|
||||
if (rank < 9)
|
||||
const auto rank = static_cast<size_t>(std::max(0, factionRank));
|
||||
if (rank < faction->mRanks.size())
|
||||
text += std::string("\n#{fontcolourhtml=normal}") + faction->mRanks[rank];
|
||||
if (rank + 1 < faction->mRanks.size() && !faction->mRanks[rank + 1].empty())
|
||||
{
|
||||
// player doesn't have max rank yet
|
||||
text += std::string("\n\n#{fontcolourhtml=header}#{sNextRank} ") + faction->mRanks[rank + 1];
|
||||
|
Loading…
Reference in New Issue
Block a user