From c22f773f7231243d9e142a3c55122cfd875073e3 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 11 May 2013 17:45:28 +0200 Subject: [PATCH] load all types of referenceable IDs --- apps/opencs/model/world/data.cpp | 22 ++++++++++++ apps/opencs/model/world/refidcollection.cpp | 40 ++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index db6629aa09..1701e42899 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -327,7 +327,29 @@ void CSMWorld::Data::loadFile (const boost::filesystem::path& path, bool base) case ESM::REC_SPEL: mSpells.load (reader, base); break; case ESM::REC_CELL: mCells.load (reader, base); break; + case ESM::REC_ACTI: mReferenceables.load (reader, base, UniversalId::Type_Activator); break; + case ESM::REC_ALCH: mReferenceables.load (reader, base, UniversalId::Type_Potion); break; + case ESM::REC_APPA: mReferenceables.load (reader, base, UniversalId::Type_Apparatus); break; + case ESM::REC_ARMO: mReferenceables.load (reader, base, UniversalId::Type_Armor); break; + case ESM::REC_BOOK: mReferenceables.load (reader, base, UniversalId::Type_Book); break; + case ESM::REC_CLOT: mReferenceables.load (reader, base, UniversalId::Type_Clothing); break; + case ESM::REC_CONT: mReferenceables.load (reader, base, UniversalId::Type_Container); break; + case ESM::REC_CREA: mReferenceables.load (reader, base, UniversalId::Type_Creature); break; + case ESM::REC_DOOR: mReferenceables.load (reader, base, UniversalId::Type_Door); break; + case ESM::REC_INGR: mReferenceables.load (reader, base, UniversalId::Type_Ingredient); break; + case ESM::REC_LEVC: + mReferenceables.load (reader, base, UniversalId::Type_CreatureLevelledList); break; + case ESM::REC_LEVI: + mReferenceables.load (reader, base, UniversalId::Type_ItemLevelledList); break; + case ESM::REC_LIGH: mReferenceables.load (reader, base, UniversalId::Type_Light); break; + case ESM::REC_LOCK: mReferenceables.load (reader, base, UniversalId::Type_Lockpick); break; + case ESM::REC_MISC: + mReferenceables.load (reader, base, UniversalId::Type_Miscellaneous); break; + case ESM::REC_NPC_: mReferenceables.load (reader, base, UniversalId::Type_Npc); break; + case ESM::REC_PROB: mReferenceables.load (reader, base, UniversalId::Type_Probe); break; + case ESM::REC_REPA: mReferenceables.load (reader, base, UniversalId::Type_Repair); break; case ESM::REC_STAT: mReferenceables.load (reader, base, UniversalId::Type_Static); break; + case ESM::REC_WEAP: mReferenceables.load (reader, base, UniversalId::Type_Weapon); break; default: diff --git a/apps/opencs/model/world/refidcollection.cpp b/apps/opencs/model/world/refidcollection.cpp index c2969bf9c7..18feb7424c 100644 --- a/apps/opencs/model/world/refidcollection.cpp +++ b/apps/opencs/model/world/refidcollection.cpp @@ -46,9 +46,47 @@ CSMWorld::RefIdCollection::RefIdCollection() + mAdapters.insert (std::make_pair (UniversalId::Type_Activator, + new BaseRefIdAdapter (UniversalId::Type_Activator, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Potion, + new BaseRefIdAdapter (UniversalId::Type_Potion, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Apparatus, + new BaseRefIdAdapter (UniversalId::Type_Apparatus, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Armor, + new BaseRefIdAdapter (UniversalId::Type_Armor, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Book, + new BaseRefIdAdapter (UniversalId::Type_Book, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Clothing, + new BaseRefIdAdapter (UniversalId::Type_Clothing, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Container, + new BaseRefIdAdapter (UniversalId::Type_Container, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Creature, + new BaseRefIdAdapter (UniversalId::Type_Creature, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Door, + new BaseRefIdAdapter (UniversalId::Type_Door, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Ingredient, + new BaseRefIdAdapter (UniversalId::Type_Ingredient, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_CreatureLevelledList, + new BaseRefIdAdapter ( + UniversalId::Type_CreatureLevelledList, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_ItemLevelledList, + new BaseRefIdAdapter (UniversalId::Type_ItemLevelledList, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Light, + new BaseRefIdAdapter (UniversalId::Type_Light, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Lockpick, + new BaseRefIdAdapter (UniversalId::Type_Lockpick, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Miscellaneous, + new BaseRefIdAdapter (UniversalId::Type_Miscellaneous, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Npc, + new BaseRefIdAdapter (UniversalId::Type_Npc, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Probe, + new BaseRefIdAdapter (UniversalId::Type_Probe, baseColumns))); + mAdapters.insert (std::make_pair (UniversalId::Type_Repair, + new BaseRefIdAdapter (UniversalId::Type_Repair, baseColumns))); mAdapters.insert (std::make_pair (UniversalId::Type_Static, new BaseRefIdAdapter (UniversalId::Type_Static, baseColumns))); - + mAdapters.insert (std::make_pair (UniversalId::Type_Weapon, + new BaseRefIdAdapter (UniversalId::Type_Weapon, baseColumns))); } CSMWorld::RefIdCollection::~RefIdCollection()