1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 20:23:54 +00:00

Merge branch 'delevelled' into 'master'

Editor: Decouple levelled list table columns (bug #6705)

Closes #6705

See merge request OpenMW/openmw!2209
This commit is contained in:
psi29a 2022-07-30 12:17:07 +00:00
commit a62b16df5d
4 changed files with 31 additions and 14 deletions

View file

@ -129,6 +129,7 @@
Bug #6680: object.cpp handles nodetree unsafely, memory access with dangling pointer Bug #6680: object.cpp handles nodetree unsafely, memory access with dangling pointer
Bug #6682: HitOnMe doesn't fire as intended Bug #6682: HitOnMe doesn't fire as intended
Bug #6697: Shaders vertex lighting incorrectly clamped Bug #6697: Shaders vertex lighting incorrectly clamped
Bug #6705: OpenMW CS: A typo in the Creature levelled list
Bug #6711: Log time differs from real time Bug #6711: Log time differs from real time
Bug #6717: Broken script causes interpreter stack corruption Bug #6717: Broken script causes interpreter stack corruption
Bug #6718: Throwable weapons cause arrow enchantment effect to be applied to the whole body Bug #6718: Throwable weapons cause arrow enchantment effect to be applied to the whole body

View file

@ -267,7 +267,7 @@ namespace CSMWorld
{ ColumnId_LevelledList,"Levelled List" }, { ColumnId_LevelledList,"Levelled List" },
{ ColumnId_LevelledItemId,"Levelled Item" }, { ColumnId_LevelledItemId,"Levelled Item" },
{ ColumnId_LevelledItemLevel,"Item Level" }, { ColumnId_LevelledItemLevel,"PC Level" },
{ ColumnId_LevelledItemType, "Calculate all levels <= player" }, { ColumnId_LevelledItemType, "Calculate all levels <= player" },
{ ColumnId_LevelledItemTypeEach, "Select a new item for each instance" }, { ColumnId_LevelledItemTypeEach, "Select a new item for each instance" },
{ ColumnId_LevelledItemChanceNone, "Chance None" }, { ColumnId_LevelledItemChanceNone, "Chance None" },
@ -373,6 +373,8 @@ namespace CSMWorld
{ ColumnId_Persistent, "Persistent" }, { ColumnId_Persistent, "Persistent" },
{ ColumnId_Blocked, "Blocked" }, { ColumnId_Blocked, "Blocked" },
{ ColumnId_LevelledCreatureId,"Levelled Creature" },
{ -1, 0 } // end marker { -1, 0 } // end marker
}; };
} }

View file

@ -346,6 +346,8 @@ namespace CSMWorld
ColumnId_Persistent = 313, ColumnId_Persistent = 313,
ColumnId_Blocked = 314, ColumnId_Blocked = 314,
ColumnId_LevelledCreatureId = 315,
// Allocated to a separate value range, so we don't get a collision should we ever need // Allocated to a separate value range, so we don't get a collision should we ever need
// to extend the number of use values. // to extend the number of use values.
ColumnId_UseValue1 = 0x10000, ColumnId_UseValue1 = 0x10000,

View file

@ -617,27 +617,39 @@ CSMWorld::RefIdCollection::RefIdCollection()
mColumns.back().addColumn( mColumns.back().addColumn(
new RefIdColumn (Columns::ColumnId_PartRefFemale, CSMWorld::ColumnBase::Display_BodyPart)); new RefIdColumn (Columns::ColumnId_PartRefFemale, CSMWorld::ColumnBase::Display_BodyPart));
LevListColumns levListColumns (baseColumns); LevListColumns creatureLevListColumns (baseColumns);
LevListColumns itemLevListColumns (baseColumns);
std::map<UniversalId::Type, NestedRefIdAdapterBase*> creatureLevListMap, itemLevListMap;
creatureLevListMap.insert(std::make_pair(UniversalId::Type_CreatureLevelledList,
new NestedLevListRefIdAdapter<ESM::CreatureLevList> (UniversalId::Type_CreatureLevelledList)));
itemLevListMap.insert(std::make_pair(UniversalId::Type_ItemLevelledList,
new NestedLevListRefIdAdapter<ESM::ItemLevList> (UniversalId::Type_ItemLevelledList)));
// Nested table // Levelled creature nested table
mColumns.emplace_back(Columns::ColumnId_LevelledList, mColumns.emplace_back(Columns::ColumnId_LevelledList,
ColumnBase::Display_NestedHeader, ColumnBase::Flag_Dialogue); ColumnBase::Display_NestedHeader, ColumnBase::Flag_Dialogue);
levListColumns.mLevList = &mColumns.back(); creatureLevListColumns.mLevList = &mColumns.back();
std::map<UniversalId::Type, NestedRefIdAdapterBase*> levListMap; mNestedAdapters.emplace_back(&mColumns.back(), creatureLevListMap);
levListMap.insert(std::make_pair(UniversalId::Type_CreatureLevelledList, mColumns.back().addColumn(
new NestedLevListRefIdAdapter<ESM::CreatureLevList> (UniversalId::Type_CreatureLevelledList))); new RefIdColumn (Columns::ColumnId_LevelledCreatureId, CSMWorld::ColumnBase::Display_Referenceable));
levListMap.insert(std::make_pair(UniversalId::Type_ItemLevelledList, mColumns.back().addColumn(
new NestedLevListRefIdAdapter<ESM::ItemLevList> (UniversalId::Type_ItemLevelledList))); new RefIdColumn (Columns::ColumnId_LevelledItemLevel, CSMWorld::ColumnBase::Display_Integer));
mNestedAdapters.emplace_back(&mColumns.back(), levListMap);
// Levelled item nested table
mColumns.emplace_back(Columns::ColumnId_LevelledList,
ColumnBase::Display_NestedHeader, ColumnBase::Flag_Dialogue);
itemLevListColumns.mLevList = &mColumns.back();
mNestedAdapters.emplace_back(&mColumns.back(), itemLevListMap);
mColumns.back().addColumn( mColumns.back().addColumn(
new RefIdColumn (Columns::ColumnId_LevelledItemId, CSMWorld::ColumnBase::Display_Referenceable)); new RefIdColumn (Columns::ColumnId_LevelledItemId, CSMWorld::ColumnBase::Display_Referenceable));
mColumns.back().addColumn( mColumns.back().addColumn(
new RefIdColumn (Columns::ColumnId_LevelledItemLevel, CSMWorld::ColumnBase::Display_Integer)); new RefIdColumn (Columns::ColumnId_LevelledItemLevel, CSMWorld::ColumnBase::Display_Integer));
// Nested list // Shared levelled list nested list
mColumns.emplace_back(Columns::ColumnId_LevelledList, mColumns.emplace_back(Columns::ColumnId_LevelledList,
ColumnBase::Display_NestedHeader, ColumnBase::Flag_Dialogue | ColumnBase::Flag_Dialogue_List); ColumnBase::Display_NestedHeader, ColumnBase::Flag_Dialogue | ColumnBase::Flag_Dialogue_List);
levListColumns.mNestedListLevList = &mColumns.back(); creatureLevListColumns.mNestedListLevList = &mColumns.back();
itemLevListColumns.mNestedListLevList = &mColumns.back();
std::map<UniversalId::Type, NestedRefIdAdapterBase*> nestedListLevListMap; std::map<UniversalId::Type, NestedRefIdAdapterBase*> nestedListLevListMap;
nestedListLevListMap.insert(std::make_pair(UniversalId::Type_CreatureLevelledList, nestedListLevListMap.insert(std::make_pair(UniversalId::Type_CreatureLevelledList,
new NestedListLevListRefIdAdapter<ESM::CreatureLevList> (UniversalId::Type_CreatureLevelledList))); new NestedListLevListRefIdAdapter<ESM::CreatureLevList> (UniversalId::Type_CreatureLevelledList)));
@ -673,9 +685,9 @@ CSMWorld::RefIdCollection::RefIdCollection()
new IngredientRefIdAdapter (ingredientColumns))); new IngredientRefIdAdapter (ingredientColumns)));
mAdapters.insert (std::make_pair (UniversalId::Type_CreatureLevelledList, mAdapters.insert (std::make_pair (UniversalId::Type_CreatureLevelledList,
new LevelledListRefIdAdapter<ESM::CreatureLevList> ( new LevelledListRefIdAdapter<ESM::CreatureLevList> (
UniversalId::Type_CreatureLevelledList, levListColumns))); UniversalId::Type_CreatureLevelledList, creatureLevListColumns)));
mAdapters.insert (std::make_pair (UniversalId::Type_ItemLevelledList, mAdapters.insert (std::make_pair (UniversalId::Type_ItemLevelledList,
new LevelledListRefIdAdapter<ESM::ItemLevList> (UniversalId::Type_ItemLevelledList, levListColumns))); new LevelledListRefIdAdapter<ESM::ItemLevList> (UniversalId::Type_ItemLevelledList, itemLevListColumns)));
mAdapters.insert (std::make_pair (UniversalId::Type_Light, mAdapters.insert (std::make_pair (UniversalId::Type_Light,
new LightRefIdAdapter (lightColumns))); new LightRefIdAdapter (lightColumns)));
mAdapters.insert (std::make_pair (UniversalId::Type_Lockpick, mAdapters.insert (std::make_pair (UniversalId::Type_Lockpick,