From 1470c8c308554e6a0e12f30b022b9206f8424daf Mon Sep 17 00:00:00 2001 From: momo5502 Date: Fri, 21 Apr 2017 20:49:06 +0200 Subject: [PATCH] [ZoneBuilder] Add non-redundant iwi dumper --- src/Components/Modules/ZoneBuilder.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/Components/Modules/ZoneBuilder.cpp b/src/Components/Modules/ZoneBuilder.cpp index 548a6b37..7cbae8cf 100644 --- a/src/Components/Modules/ZoneBuilder.cpp +++ b/src/Components/Modules/ZoneBuilder.cpp @@ -955,6 +955,31 @@ namespace Components Logger::Print("%s: %X %X %X\n", header.material->name, header.material->sortKey & 0xFF, header.material->gameFlags & 0xFF, header.material->stateFlags & 0xFF); }, nullptr, false); }); + + Command::Add("iwiDump", [](Command::Params* params) + { + if (params->length() < 2) return; + + std::string path = Utils::String::VA("%s\\mods\\%s\\images", Dvar::Var("fs_basepath").get(), params->get(1)); + std::vector images = FileSystem::GetSysFileList(path, "iwi", false); + + for(auto i = images.begin(); i != images.end();) + { + *i = Utils::String::VA("images/%s", i->data()); + + if(FileSystem::File(*i).exists()) + { + i = images.erase(i); + continue; + } + + ++i; + } + + Logger::Print("------------------- BEGIN IWI DUMP -------------------\n"); + Logger::Print("%s\n", json11::Json(images).dump().data()); + Logger::Print("------------------- END IWI DUMP -------------------\n"); + }); } }