#ifndef OPENMW_ESM_LUASCRIPTS_H #define OPENMW_ESM_LUASCRIPTS_H #include #include namespace ESM { class ESMReader; class ESMWriter; // Storage structure for LuaUtil::ScriptsContainer. This is not a top-level record. // Used either for global scripts or for local scripts on a specific object. struct LuaTimer { double mTime; bool mHours; // false - game seconds, true - game hours std::string mCallbackName; std::string mCallbackArgument; // Serialized Lua table. It is a binary data. Can contain '\0'. }; struct LuaScript { std::string mScriptPath; std::string mData; // Serialized Lua table. It is a binary data. Can contain '\0'. std::vector mTimers; }; struct LuaScripts { std::vector mScripts; void load (ESMReader &esm); void save (ESMWriter &esm) const; }; // Saves binary string `data` (can contain '\0') as record LUAD. void saveLuaBinaryData(ESM::ESMWriter& esm, const std::string& data); // Loads LUAD as binary string. If next subrecord is not LUAD, then returns an empty string. std::string loadLuaBinaryData(ESM::ESMReader& esm); } #endif