| 284 | } |
| 285 | |
| 286 | std::string scriptCfgToString(const ESM::LuaScriptCfg& script) |
| 287 | { |
| 288 | std::stringstream ss; |
| 289 | if (script.mFlags & ESM::LuaScriptCfg::sMerge) |
| 290 | ss << "+ "; |
| 291 | for (const auto& [flagName, flag] : flagsByName) |
| 292 | { |
| 293 | if (script.mFlags & flag) |
| 294 | ss << flagName << " "; |
| 295 | } |
| 296 | for (uint32_t type : script.mTypes) |
| 297 | { |
| 298 | for (const auto& [tagName, t] : typeTagsByName) |
| 299 | { |
| 300 | if (type == t) |
| 301 | ss << tagName << " "; |
| 302 | } |
| 303 | } |
| 304 | ss << ": " << script.mScriptPath; |
| 305 | if (!script.mInitializationData.empty()) |
| 306 | ss << " ; data " << script.mInitializationData.size() << " bytes"; |
| 307 | if (!script.mRecords.empty()) |
| 308 | ss << " ; " << script.mRecords.size() << " records"; |
| 309 | if (!script.mRefs.empty()) |
| 310 | ss << " ; " << script.mRefs.size() << " objects"; |
| 311 | return ss.str(); |
| 312 | } |
| 313 | |
| 314 | } |