From 8bf02b5880c31aee2a052f4d9fc12a0afba68210 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 5 May 2026 11:48:57 -0700 Subject: [PATCH] feat(editor): zone stats.json export with open format score and content summary --- tools/editor/editor_app.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/editor/editor_app.cpp b/tools/editor/editor_app.cpp index 2ed2199b..a9e29eea 100644 --- a/tools/editor/editor_app.cpp +++ b/tools/editor/editor_app.cpp @@ -851,6 +851,23 @@ void EditorApp::exportZone(const std::string& outputDir) { // Validate open format completeness auto validation = ContentPacker::validateZone(base); int score = validation.openFormatScore(); + // Write zone statistics JSON + { + std::ofstream stats(base + "/stats.json"); + if (stats) { + stats << "{\n"; + stats << " \"map\": \"" << loadedMap_ << "\",\n"; + stats << " \"tile\": [" << loadedTileX_ << "," << loadedTileY_ << "],\n"; + stats << " \"objects\": " << objectPlacer_.objectCount() << ",\n"; + stats << " \"npcs\": " << npcSpawner_.spawnCount() << ",\n"; + stats << " \"quests\": " << questEditor_.questCount() << ",\n"; + stats << " \"textures\": " << usedTextures.size() << ",\n"; + stats << " \"openFormatScore\": " << score << ",\n"; + stats << " \"formats\": \"" << validation.summary() << "\"\n"; + stats << "}\n"; + } + } + showToast("Exported " + std::to_string(fileCount) + " files (" + std::to_string(score) + "/5 open format)"); LOG_INFO("=== Zone Export Summary ===");