From d56ea9ae647d1bb5be240dbf2d5639e8fbefe190 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 5 May 2026 08:10:21 -0700 Subject: [PATCH] feat(editor): Randomize All button for instant terrain exploration --- tools/editor/editor_ui.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/editor/editor_ui.cpp b/tools/editor/editor_ui.cpp index 45b5c059..b6b8baa7 100644 --- a/tools/editor/editor_ui.cpp +++ b/tools/editor/editor_ui.cpp @@ -510,7 +510,16 @@ void EditorUI::renderBrushPanel(EditorApp& app) { ImGui::SliderInt("Octaves", &noiseOctaves, 1, 8); ImGui::InputInt("Seed", &noiseSeed); ImGui::SameLine(); - if (ImGui::SmallButton("Random##seed")) noiseSeed = static_cast(std::rand()); + if (ImGui::SmallButton("Rnd")) noiseSeed = static_cast(std::rand()); + ImGui::SameLine(); + if (ImGui::SmallButton("Randomize All")) { + noiseSeed = static_cast(std::rand()); + app.getTerrainEditor().resetToFlat(); + app.getTerrainEditor().applyNoise(noiseFreq, noiseAmp, noiseOctaves, + static_cast(noiseSeed)); + app.getTerrainEditor().smoothEntireTile(2); + app.showToast("Randomized (seed " + std::to_string(noiseSeed) + ")"); + } static int noiseType = 0; ImGui::RadioButton("Value##nt", &noiseType, 0); ImGui::SameLine();