mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 09:03:52 +00:00
feat(editor): stamp persistence, WCP file preview, enriched stats
- Terrain stamps save/load to JSON: reuse terrain features across zones and sessions. Save/Load buttons in Sculpt > Stamp/Clone panel - WCP Inspect now shows full file breakdown: terrain/model/building/ texture/data counts with total size. Powered by readInfo file list parsing with auto-categorization by extension - stats.json now includes chunk count, triangle count, tile count, and editor version alongside existing object/NPC/quest/texture counts - Fix unprotected std::stoi in custom zone WOT filename parser
This commit is contained in:
parent
d3e8f999c7
commit
7473728360
5 changed files with 117 additions and 10 deletions
|
|
@ -159,6 +159,26 @@ bool ContentPacker::readInfo(const std::string& wcpPath, ContentPackInfo& info)
|
|||
info.version = j.value("version", "");
|
||||
info.format = j.value("format", "");
|
||||
info.mapId = j.value("mapId", 9000u);
|
||||
info.files.clear();
|
||||
if (j.contains("files") && j["files"].is_array()) {
|
||||
for (const auto& jf : j["files"]) {
|
||||
ContentPackInfo::FileEntry fe;
|
||||
fe.path = jf.value("path", "");
|
||||
fe.size = jf.value("size", 0ULL);
|
||||
auto dot = fe.path.rfind('.');
|
||||
if (dot != std::string::npos) {
|
||||
std::string ext = fe.path.substr(dot);
|
||||
if (ext == ".wot" || ext == ".whm") fe.category = "terrain";
|
||||
else if (ext == ".wom") fe.category = "model";
|
||||
else if (ext == ".wob") fe.category = "building";
|
||||
else if (ext == ".png") fe.category = "texture";
|
||||
else if (ext == ".json") fe.category = "data";
|
||||
else if (ext == ".adt" || ext == ".wdt") fe.category = "legacy";
|
||||
else fe.category = "other";
|
||||
}
|
||||
info.files.push_back(fe);
|
||||
}
|
||||
}
|
||||
} catch (...) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue