Merge branch 'imod' into 'master'

Fill out item modification records and add them to the scene

See merge request OpenMW/openmw!3540
macos_ci_fix
Zackhasacat 1 year ago
commit 13deb0fba8

@ -11,6 +11,7 @@
#include <components/esm4/loaddoor.hpp>
#include <components/esm4/loadflor.hpp>
#include <components/esm4/loadfurn.hpp>
#include <components/esm4/loadimod.hpp>
#include <components/esm4/loadingr.hpp>
#include <components/esm4/loadligh.hpp>
#include <components/esm4/loadmisc.hpp>
@ -84,6 +85,7 @@ namespace MWClass
ESM4Named<ESM4::Flora>::registerSelf();
ESM4Named<ESM4::Furniture>::registerSelf();
ESM4Named<ESM4::Ingredient>::registerSelf();
ESM4Named<ESM4::ItemMod>::registerSelf();
ESM4Light::registerSelf();
ESM4Named<ESM4::MiscItem>::registerSelf();
ESM4Named<ESM4::MovableStatic>::registerSelf();

@ -33,6 +33,7 @@
#include <components/esm4/loaddoor.hpp>
#include <components/esm4/loadflor.hpp>
#include <components/esm4/loadfurn.hpp>
#include <components/esm4/loadimod.hpp>
#include <components/esm4/loadingr.hpp>
#include <components/esm4/loadligh.hpp>
#include <components/esm4/loadmisc.hpp>
@ -232,6 +233,9 @@ namespace MWLua
case ESM::REC_FURN4:
cell.mStore->template forEachType<ESM4::Furniture>(visitor);
break;
case ESM::REC_IMOD4:
cell.mStore->template forEachType<ESM4::ItemMod>(visitor);
break;
case ESM::REC_INGR4:
cell.mStore->template forEachType<ESM4::Ingredient>(visitor);
break;

@ -45,6 +45,7 @@ namespace MWLua
constexpr std::string_view ESM4Flora = "ESM4Flora";
constexpr std::string_view ESM4Furniture = "ESM4Furniture";
constexpr std::string_view ESM4Ingredient = "ESM4Ingredient";
constexpr std::string_view ESM4ItemMod = "ESM4ItemMod";
constexpr std::string_view ESM4Light = "ESM4Light";
constexpr std::string_view ESM4MiscItem = "ESM4Miscellaneous";
constexpr std::string_view ESM4MovableStatic = "ESM4MovableStatic";
@ -90,6 +91,7 @@ namespace MWLua
{ ESM::REC_FLOR4, ObjectTypeName::ESM4Flora },
{ ESM::REC_FURN4, ObjectTypeName::ESM4Furniture },
{ ESM::REC_INGR4, ObjectTypeName::ESM4Ingredient },
{ ESM::REC_IMOD4, ObjectTypeName::ESM4ItemMod },
{ ESM::REC_LIGH4, ObjectTypeName::ESM4Light },
{ ESM::REC_MISC4, ObjectTypeName::ESM4MiscItem },
{ ESM::REC_MSTT4, ObjectTypeName::ESM4MovableStatic },
@ -230,6 +232,7 @@ namespace MWLua
addType(ObjectTypeName::ESM4Flora, { ESM::REC_FLOR4 });
addType(ObjectTypeName::ESM4Furniture, { ESM::REC_FURN4 });
addType(ObjectTypeName::ESM4Ingredient, { ESM::REC_INGR4 });
addType(ObjectTypeName::ESM4ItemMod, { ESM::REC_IMOD4 });
addType(ObjectTypeName::ESM4Light, { ESM::REC_LIGH4 });
addType(ObjectTypeName::ESM4MiscItem, { ESM::REC_MISC4 });
addType(ObjectTypeName::ESM4MovableStatic, { ESM::REC_MSTT4 });

@ -54,6 +54,7 @@
#include <components/esm4/loaddoor.hpp>
#include <components/esm4/loadflor.hpp>
#include <components/esm4/loadfurn.hpp>
#include <components/esm4/loadimod.hpp>
#include <components/esm4/loadingr.hpp>
#include <components/esm4/loadligh.hpp>
#include <components/esm4/loadmisc.hpp>

@ -72,6 +72,7 @@ namespace ESM4
struct Furniture;
struct Flora;
struct Ingredient;
struct ItemMod;
struct MiscItem;
struct MovableStatic;
struct Terminal;
@ -96,7 +97,7 @@ namespace MWWorld
CellRefList<ESM4::Static>, CellRefList<ESM4::Light>, CellRefList<ESM4::Activator>, CellRefList<ESM4::Potion>,
CellRefList<ESM4::Ammunition>, CellRefList<ESM4::Armor>, CellRefList<ESM4::Book>, CellRefList<ESM4::Clothing>,
CellRefList<ESM4::Container>, CellRefList<ESM4::Door>, CellRefList<ESM4::Flora>, CellRefList<ESM4::Ingredient>,
CellRefList<ESM4::Terminal>, CellRefList<ESM4::Tree>, CellRefList<ESM4::MiscItem>,
CellRefList<ESM4::ItemMod>, CellRefList<ESM4::Terminal>, CellRefList<ESM4::Tree>, CellRefList<ESM4::MiscItem>,
CellRefList<ESM4::MovableStatic>, CellRefList<ESM4::Weapon>, CellRefList<ESM4::Furniture>,
CellRefList<ESM4::Creature>, CellRefList<ESM4::Npc>>;

@ -91,6 +91,7 @@ namespace ESM4
struct Hair;
struct HeadPart;
struct Ingredient;
struct ItemMod;
struct Land;
struct LandTexture;
struct LevelledCreature;
@ -140,8 +141,8 @@ namespace MWWorld
Store<ESM4::Activator>, Store<ESM4::ActorCharacter>, Store<ESM4::ActorCreature>, Store<ESM4::Ammunition>,
Store<ESM4::Armor>, Store<ESM4::ArmorAddon>, Store<ESM4::Book>, Store<ESM4::Cell>, Store<ESM4::Clothing>,
Store<ESM4::Container>, Store<ESM4::Creature>, Store<ESM4::Door>, Store<ESM4::Furniture>,
Store<ESM4::Flora>, Store<ESM4::Hair>, Store<ESM4::HeadPart>, Store<ESM4::Ingredient>, Store<ESM4::Land>,
Store<ESM4::LandTexture>, Store<ESM4::LevelledCreature>, Store<ESM4::LevelledItem>,
Store<ESM4::Flora>, Store<ESM4::Hair>, Store<ESM4::HeadPart>, Store<ESM4::Ingredient>, Store<ESM4::ItemMod>,
Store<ESM4::Land>, Store<ESM4::LandTexture>, Store<ESM4::LevelledCreature>, Store<ESM4::LevelledItem>,
Store<ESM4::LevelledNpc>, Store<ESM4::Light>, Store<ESM4::MiscItem>, Store<ESM4::MovableStatic>,
Store<ESM4::Npc>, Store<ESM4::Outfit>, Store<ESM4::Potion>, Store<ESM4::Race>, Store<ESM4::Reference>,
Store<ESM4::Static>, Store<ESM4::Terminal>, Store<ESM4::Tree>, Store<ESM4::Weapon>, Store<ESM4::World>>;

@ -1362,6 +1362,7 @@ template class MWWorld::TypedDynamicStore<ESM4::Furniture>;
template class MWWorld::TypedDynamicStore<ESM4::Hair>;
template class MWWorld::TypedDynamicStore<ESM4::HeadPart>;
template class MWWorld::TypedDynamicStore<ESM4::Ingredient>;
template class MWWorld::TypedDynamicStore<ESM4::ItemMod>;
template class MWWorld::TypedDynamicStore<ESM4::Land>;
template class MWWorld::TypedDynamicStore<ESM4::LandTexture>;
template class MWWorld::TypedDynamicStore<ESM4::LevelledCreature>;

@ -59,6 +59,7 @@
#include <components/esm4/loadfurn.hpp>
#include <components/esm4/loadhair.hpp>
#include <components/esm4/loadhdpt.hpp>
#include <components/esm4/loadimod.hpp>
#include <components/esm4/loadingr.hpp>
#include <components/esm4/loadland.hpp>
#include <components/esm4/loadligh.hpp>

@ -46,16 +46,50 @@ void ESM4::ItemMod::load(ESM4::Reader& reader)
case ESM4::SUB_EDID:
reader.getZString(mEditorId);
break;
case ESM4::SUB_OBND:
case ESM4::SUB_FULL:
reader.getLocalizedString(mFullName);
break;
case ESM4::SUB_MODL:
reader.getZString(mModel);
break;
case ESM4::SUB_MODB:
reader.get(mBoundRadius);
break;
case ESM4::SUB_DESC:
reader.getLocalizedString(mText);
break;
case ESM4::SUB_ICON:
reader.getZString(mIcon);
break;
case ESM4::SUB_MICO:
reader.getZString(mMiniIcon);
break;
case ESM4::SUB_SCRI:
case ESM4::SUB_DESC:
reader.getFormId(mScriptId);
break;
case ESM4::SUB_YNAM:
reader.getFormId(mPickUpSound);
break;
case ESM4::SUB_ZNAM:
reader.getFormId(mDropSound);
break;
case ESM4::SUB_DATA:
reader.get(mData.mValue);
reader.get(mData.mWeight);
break;
case ESM4::SUB_OBND:
case ESM4::SUB_MODT: // Model data
case ESM4::SUB_MODS:
case ESM4::SUB_MODD: // Model data end
case ESM4::SUB_DAMC: // Destructible
case ESM4::SUB_DEST:
case ESM4::SUB_DMDC:
case ESM4::SUB_DMDL:
case ESM4::SUB_DMDT:
case ESM4::SUB_DMDS:
case ESM4::SUB_DSTA:
case ESM4::SUB_DSTD:
case ESM4::SUB_DSTF: // Destructible end
reader.skipSubRecordData();
break;
default:

@ -42,10 +42,29 @@ namespace ESM4
struct ItemMod
{
struct Data
{
std::uint32_t mValue{ 0 };
float mWeight{ 0.f };
};
ESM::FormId mId; // from the header
std::uint32_t mFlags; // from the header, see enum type RecordFlag for details
std::string mEditorId;
std::string mFullName;
std::string mModel;
std::string mText;
std::string mIcon;
std::string mMiniIcon;
ESM::FormId mScriptId;
ESM::FormId mPickUpSound;
ESM::FormId mDropSound;
float mBoundRadius;
Data mData;
void load(ESM4::Reader& reader);
// void save(ESM4::Writer& writer) const;

@ -1880,6 +1880,9 @@
--- Functions for @{#ESM4Ingredient} objects
-- @field [parent=#types] #ESM4Ingredient ESM4Ingredient
--- Functions for @{#ESM4ItemMod} objects
-- @field [parent=#types] #ESM4ItemMod ESM4ItemMod
--- Functions for @{#ESM4Light} objects
-- @field [parent=#types] #ESM4Light ESM4Light

Loading…
Cancel
Save