From e191f35ed0c7440dff6fee1971d8755efb7116b7 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 5 May 2026 10:47:18 -0700 Subject: [PATCH] feat(editor): content pack inspector and improved import UI --- tools/editor/editor_ui.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tools/editor/editor_ui.cpp b/tools/editor/editor_ui.cpp index 4fffe613..ea793d87 100644 --- a/tools/editor/editor_ui.cpp +++ b/tools/editor/editor_ui.cpp @@ -242,11 +242,23 @@ void EditorUI::renderMenuBar(EditorApp& app) { } ImGui::EndMenu(); } - if (ImGui::MenuItem("Import Content Pack (.wcp)")) { + if (ImGui::BeginMenu("Content Packs (.wcp)")) { static char wcpImportPath[256] = "content.wcp"; - // Simple import — unpack to custom_zones/ - editor::ContentPacker::unpackZone(wcpImportPath, "custom_zones"); - app.showToast("Content pack imported to custom_zones/"); + ImGui::InputText("Path##wcp", wcpImportPath, sizeof(wcpImportPath)); + if (ImGui::MenuItem("Import (unpack to custom_zones/)")) { + if (editor::ContentPacker::unpackZone(wcpImportPath, "custom_zones")) + app.showToast("Content pack imported"); + else + app.showToast("Import failed — check path"); + } + if (ImGui::MenuItem("Inspect Pack Info")) { + editor::ContentPackInfo info; + if (editor::ContentPacker::readInfo(wcpImportPath, info)) + app.showToast(info.name + " by " + info.author + " (" + info.version + ")"); + else + app.showToast("Cannot read pack info"); + } + ImGui::EndMenu(); } if (ImGui::BeginMenu("Import Heightmap", app.hasTerrainLoaded())) { static char hmPath[256] = "heightmap.raw";