From 28d63addc4dd430b23a449788c053270070fa635 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 5 May 2026 14:00:49 -0700 Subject: [PATCH] feat(editor): brush size presets/hotkeys, export dialog update - Brush size presets: S(15)/M(50)/L(100)/XL(180) buttons in sculpt panel - [ / ] bracket keys adjust brush radius by 10 units (clamped 5-200) - Export dialog now lists all output formats (ADT+WDT, WOT+WHM, WOM, WOB, PNG, JSON) instead of just ADT/WDT - Document bracket keys in help panel --- tools/editor/editor_app.cpp | 9 +++++++++ tools/editor/editor_ui.cpp | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tools/editor/editor_app.cpp b/tools/editor/editor_app.cpp index fc6802ee..5df34fa3 100644 --- a/tools/editor/editor_app.cpp +++ b/tools/editor/editor_app.cpp @@ -268,6 +268,15 @@ void EditorApp::processEvents() { if (sc == SDL_SCANCODE_4) setMode(EditorMode::Water); if (sc == SDL_SCANCODE_5) setMode(EditorMode::NPC); if (sc == SDL_SCANCODE_6) setMode(EditorMode::Quest); + // Bracket keys adjust brush size + if (sc == SDL_SCANCODE_LEFTBRACKET) { + auto& bs = terrainEditor_.brush().settings(); + bs.radius = std::max(5.0f, bs.radius - 10.0f); + } + if (sc == SDL_SCANCODE_RIGHTBRACKET) { + auto& bs = terrainEditor_.brush().settings(); + bs.radius = std::min(200.0f, bs.radius + 10.0f); + } } // F1 handled by UI (showHelp_ toggle) // F1 = toggle help diff --git a/tools/editor/editor_ui.cpp b/tools/editor/editor_ui.cpp index d85ff7d0..90e3805c 100644 --- a/tools/editor/editor_ui.cpp +++ b/tools/editor/editor_ui.cpp @@ -484,6 +484,7 @@ void EditorUI::renderMenuBar(EditorApp& app) { ImGui::Separator(); ImGui::Text("Editing:"); ImGui::BulletText("Left-click — paint/place (depends on mode)"); + ImGui::BulletText("[ / ] — decrease / increase brush size"); ImGui::BulletText("Ctrl+click — select object/NPC"); ImGui::BulletText("Ctrl+S — quick save"); ImGui::BulletText("Ctrl+Z — undo"); @@ -707,8 +708,9 @@ void EditorUI::renderSaveDialog(EditorApp& app) { std::snprintf(savePathBuf_, sizeof(savePathBuf_), "output"); ImGui::InputText("Output Directory", savePathBuf_, sizeof(savePathBuf_)); ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1), - "Exports: ADT, WDT, and creature spawns to %s/%s/", - savePathBuf_, app.getLoadedMap().c_str()); + "Exports: ADT+WDT, WOT+WHM, WOM, WOB, PNG, JSON"); + ImGui::TextColored(ImVec4(0.5f, 0.5f, 0.5f, 1), + "Output: %s/%s/", savePathBuf_, app.getLoadedMap().c_str()); ImGui::Spacing(); if (ImGui::Button("Export All", ImVec2(140, 0))) { app.exportZone(savePathBuf_); @@ -750,6 +752,10 @@ void EditorUI::renderBrushPanel(EditorApp& app) { ImGui::SetTooltip("%s", tips[idx]); } ImGui::SliderFloat("Radius", &s.radius, 5.0f, 200.0f, "%.0f"); + if (ImGui::SmallButton("S##br")) { s.radius = 15.0f; } ImGui::SameLine(); + if (ImGui::SmallButton("M##br")) { s.radius = 50.0f; } ImGui::SameLine(); + if (ImGui::SmallButton("L##br")) { s.radius = 100.0f; } ImGui::SameLine(); + if (ImGui::SmallButton("XL##br")) { s.radius = 180.0f; } ImGui::SliderFloat("Strength", &s.strength, 0.5f, 50.0f, "%.1f"); ImGui::SliderFloat("Falloff", &s.falloff, 0.0f, 1.0f, "%.2f"); if (s.mode == BrushMode::Flatten || s.mode == BrushMode::Level) {