From d44eaec48725c77d53ab1ed1ea42f354975232f7 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 5 May 2026 13:41:05 -0700 Subject: [PATCH] feat(editor): enhanced info panel with height stats and active texture - Show active texture name in info panel when in paint mode - Display terrain height range (min/max/avg) in properties panel - Document Alt+Click eyedropper shortcut in help panel --- tools/editor/editor_ui.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tools/editor/editor_ui.cpp b/tools/editor/editor_ui.cpp index 3fcf9e55..81fe53ba 100644 --- a/tools/editor/editor_ui.cpp +++ b/tools/editor/editor_ui.cpp @@ -2218,11 +2218,21 @@ void EditorUI::renderPropertiesPanel(EditorApp& app) { ImGui::Text("Camera: %.0f, %.0f, %.0f", pos.x, pos.y, pos.z); ImGui::Text("Speed: %.0f (Shift+scroll)", app.getEditorCamera().getSpeed()); - // Cursor world position + // Cursor world position + chunk info auto& brush = app.getTerrainEditor().brush(); if (brush.isActive()) { auto bp = brush.getPosition(); ImGui::Text("Cursor: %.1f, %.1f, %.1f", bp.x, bp.y, bp.z); + + // Show active texture in paint mode + if (app.getMode() == EditorMode::Paint) { + auto& tex = app.getTexturePainter().getActiveTexture(); + if (!tex.empty()) { + auto lastSlash = tex.rfind('\\'); + ImGui::TextColored(ImVec4(0.7f, 0.9f, 0.7f, 1), "Texture: %s", + lastSlash != std::string::npos ? tex.c_str() + lastSlash + 1 : tex.c_str()); + } + } } ImGui::Separator(); @@ -2233,6 +2243,22 @@ void EditorUI::renderPropertiesPanel(EditorApp& app) { ImGui::Text("Quests: %zu", app.getQuestEditor().questCount()); + // Terrain height stats + if (auto* t = app.getTerrainEditor().getTerrain()) { + float minH = 1e30f, maxH = -1e30f, sumH = 0; + int count = 0; + for (int ci = 0; ci < 256; ci++) { + if (!t->chunks[ci].hasHeightMap()) continue; + for (int v = 0; v < 145; v++) { + float h = t->chunks[ci].position[2] + t->chunks[ci].heightMap.heights[v]; + minH = std::min(minH, h); maxH = std::max(maxH, h); + sumH += h; count++; + } + } + if (count > 0) + ImGui::Text("Height: %.0f-%.0f (avg %.0f)", minH, maxH, sumH / count); + } + if (app.getTerrainEditor().hasUnsavedChanges()) ImGui::TextColored(ImVec4(1, 0.8f, 0.3f, 1), "* Unsaved (Ctrl+S to save)"); else