forked from teamnwah/openmw-tes3coop
Merge pull request #157 from OpenMW/master
Add OpenMW commits up to 18 Feb 2017, part 2
This commit is contained in:
commit
fd4827b3a7
7 changed files with 29 additions and 7 deletions
|
@ -138,6 +138,7 @@ namespace CSMWorld
|
||||||
Display_EffectSkill, // must display at least one, unlike Display_Skill
|
Display_EffectSkill, // must display at least one, unlike Display_Skill
|
||||||
Display_EffectAttribute, // must display at least one, unlike Display_Attribute
|
Display_EffectAttribute, // must display at least one, unlike Display_Attribute
|
||||||
Display_IngredEffectId, // display none allowed, unlike Display_EffectId
|
Display_IngredEffectId, // display none allowed, unlike Display_EffectId
|
||||||
|
Display_GenderNpc, // must display at least one, unlike Display_Gender
|
||||||
|
|
||||||
//top level columns that nest other columns
|
//top level columns that nest other columns
|
||||||
Display_NestedHeader
|
Display_NestedHeader
|
||||||
|
|
|
@ -283,6 +283,7 @@ namespace CSMWorld
|
||||||
{ ColumnId_NpcMisc, "NPC Misc" },
|
{ ColumnId_NpcMisc, "NPC Misc" },
|
||||||
{ ColumnId_Level, "Level" },
|
{ ColumnId_Level, "Level" },
|
||||||
{ ColumnId_NpcFactionID, "Faction ID" },
|
{ ColumnId_NpcFactionID, "Faction ID" },
|
||||||
|
{ ColumnId_GenderNpc, "Gender"},
|
||||||
{ ColumnId_Mana, "Mana" },
|
{ ColumnId_Mana, "Mana" },
|
||||||
{ ColumnId_Fatigue, "Fatigue" },
|
{ ColumnId_Fatigue, "Fatigue" },
|
||||||
{ ColumnId_NpcDisposition, "NPC Disposition" },
|
{ ColumnId_NpcDisposition, "NPC Disposition" },
|
||||||
|
|
|
@ -276,7 +276,7 @@ namespace CSMWorld
|
||||||
ColumnId_NpcMisc = 251,
|
ColumnId_NpcMisc = 251,
|
||||||
ColumnId_Level = 252,
|
ColumnId_Level = 252,
|
||||||
ColumnId_NpcFactionID = 253,
|
ColumnId_NpcFactionID = 253,
|
||||||
// unused
|
ColumnId_GenderNpc = 254,
|
||||||
ColumnId_Mana = 255,
|
ColumnId_Mana = 255,
|
||||||
ColumnId_Fatigue = 256,
|
ColumnId_Fatigue = 256,
|
||||||
ColumnId_NpcDisposition = 257,
|
ColumnId_NpcDisposition = 257,
|
||||||
|
|
|
@ -756,7 +756,8 @@ CSMWorld::NpcColumns::NpcColumns (const ActorColumns& actorColumns)
|
||||||
mAttributes(NULL),
|
mAttributes(NULL),
|
||||||
mSkills(NULL),
|
mSkills(NULL),
|
||||||
mMisc(NULL),
|
mMisc(NULL),
|
||||||
mBloodType(NULL)
|
mBloodType(NULL),
|
||||||
|
mGender(NULL)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
CSMWorld::NpcRefIdAdapter::NpcRefIdAdapter (const NpcColumns& columns)
|
CSMWorld::NpcRefIdAdapter::NpcRefIdAdapter (const NpcColumns& columns)
|
||||||
|
@ -808,6 +809,15 @@ QVariant CSMWorld::NpcRefIdAdapter::getData (const RefIdColumn *column, const Re
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (column == mColumns.mGender)
|
||||||
|
{
|
||||||
|
// Implemented this way to allow additional gender types in the future.
|
||||||
|
if ((record.get().mFlags & ESM::NPC::Female) == ESM::NPC::Female)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
std::map<const RefIdColumn *, unsigned int>::const_iterator iter =
|
std::map<const RefIdColumn *, unsigned int>::const_iterator iter =
|
||||||
mColumns.mFlags.find (column);
|
mColumns.mFlags.find (column);
|
||||||
|
|
||||||
|
@ -846,6 +856,14 @@ void CSMWorld::NpcRefIdAdapter::setData (const RefIdColumn *column, RefIdData& d
|
||||||
else
|
else
|
||||||
npc.mFlags = npc.mFlags & mask;
|
npc.mFlags = npc.mFlags & mask;
|
||||||
}
|
}
|
||||||
|
else if (column == mColumns.mGender)
|
||||||
|
{
|
||||||
|
// Implemented this way to allow additional gender types in the future.
|
||||||
|
if (value.toInt() == 1)
|
||||||
|
npc.mFlags = (npc.mFlags & ~ESM::NPC::Female) | ESM::NPC::Female;
|
||||||
|
else
|
||||||
|
npc.mFlags = npc.mFlags & ~ESM::NPC::Female;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::map<const RefIdColumn *, unsigned int>::const_iterator iter =
|
std::map<const RefIdColumn *, unsigned int>::const_iterator iter =
|
||||||
|
|
|
@ -852,6 +852,7 @@ namespace CSMWorld
|
||||||
const RefIdColumn *mSkills; // depends on npc type
|
const RefIdColumn *mSkills; // depends on npc type
|
||||||
const RefIdColumn *mMisc; // may depend on npc type, e.g. FactionID
|
const RefIdColumn *mMisc; // may depend on npc type, e.g. FactionID
|
||||||
const RefIdColumn *mBloodType;
|
const RefIdColumn *mBloodType;
|
||||||
|
const RefIdColumn *mGender;
|
||||||
|
|
||||||
NpcColumns (const ActorColumns& actorColumns);
|
NpcColumns (const ActorColumns& actorColumns);
|
||||||
};
|
};
|
||||||
|
|
|
@ -486,8 +486,8 @@ CSMWorld::RefIdCollection::RefIdCollection()
|
||||||
mColumns.push_back (RefIdColumn (Columns::ColumnId_Head, ColumnBase::Display_BodyPart));
|
mColumns.push_back (RefIdColumn (Columns::ColumnId_Head, ColumnBase::Display_BodyPart));
|
||||||
npcColumns.mHead = &mColumns.back();
|
npcColumns.mHead = &mColumns.back();
|
||||||
|
|
||||||
mColumns.push_back (RefIdColumn (Columns::ColumnId_Female, ColumnBase::Display_Boolean));
|
mColumns.push_back (RefIdColumn (Columns::ColumnId_GenderNpc, ColumnBase::Display_GenderNpc));
|
||||||
npcColumns.mFlags.insert (std::make_pair (&mColumns.back(), ESM::NPC::Female));
|
npcColumns.mGender = &mColumns.back();
|
||||||
|
|
||||||
npcColumns.mFlags.insert (std::make_pair (essential, ESM::NPC::Essential));
|
npcColumns.mFlags.insert (std::make_pair (essential, ESM::NPC::Essential));
|
||||||
|
|
||||||
|
|
|
@ -107,9 +107,10 @@ CSVDoc::ViewManager::ViewManager (CSMDoc::DocumentManager& documentManager)
|
||||||
{ CSMWorld::ColumnBase::Display_IngredEffectId, CSMWorld::Columns::ColumnId_EffectId, true },
|
{ CSMWorld::ColumnBase::Display_IngredEffectId, CSMWorld::Columns::ColumnId_EffectId, true },
|
||||||
{ CSMWorld::ColumnBase::Display_EffectSkill, CSMWorld::Columns::ColumnId_Skill, false },
|
{ CSMWorld::ColumnBase::Display_EffectSkill, CSMWorld::Columns::ColumnId_Skill, false },
|
||||||
{ CSMWorld::ColumnBase::Display_EffectAttribute, CSMWorld::Columns::ColumnId_Attribute, false },
|
{ CSMWorld::ColumnBase::Display_EffectAttribute, CSMWorld::Columns::ColumnId_Attribute, false },
|
||||||
{ CSMWorld::ColumnBase::Display_BookType, CSMWorld::Columns::ColumnId_BookType, false},
|
{ CSMWorld::ColumnBase::Display_BookType, CSMWorld::Columns::ColumnId_BookType, false },
|
||||||
{ CSMWorld::ColumnBase::Display_BloodType, CSMWorld::Columns::ColumnId_BloodType, false},
|
{ CSMWorld::ColumnBase::Display_BloodType, CSMWorld::Columns::ColumnId_BloodType, false },
|
||||||
{ CSMWorld::ColumnBase::Display_EmitterType, CSMWorld::Columns::ColumnId_EmitterType, false}
|
{ CSMWorld::ColumnBase::Display_EmitterType, CSMWorld::Columns::ColumnId_EmitterType, false },
|
||||||
|
{ CSMWorld::ColumnBase::Display_GenderNpc, CSMWorld::Columns::ColumnId_Gender, false }
|
||||||
};
|
};
|
||||||
|
|
||||||
for (std::size_t i=0; i<sizeof (sMapping)/sizeof (Mapping); ++i)
|
for (std::size_t i=0; i<sizeof (sMapping)/sizeof (Mapping); ++i)
|
||||||
|
|
Loading…
Reference in a new issue