From ec8e3a41b594da1c04e98b5ab4794544cc695967 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 5 May 2026 09:19:02 -0700 Subject: [PATCH] fix(editor): Clear All shows toast when nothing to clear --- tools/editor/editor_ui.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/editor/editor_ui.cpp b/tools/editor/editor_ui.cpp index e7275732..b53193e0 100644 --- a/tools/editor/editor_ui.cpp +++ b/tools/editor/editor_ui.cpp @@ -147,8 +147,12 @@ void EditorUI::renderMenuBar(EditorApp& app) { } if (ImGui::MenuItem("Generate Complete Zone", nullptr, false, app.hasTerrainLoaded())) app.generateCompleteZone(); - if (ImGui::MenuItem("Clear All Objects/NPCs", nullptr, false, app.hasTerrainLoaded())) - app.clearAllObjects(); + if (ImGui::MenuItem("Clear All Objects/NPCs", nullptr, false, app.hasTerrainLoaded())) { + if (app.getObjectPlacer().objectCount() > 0 || app.getNpcSpawner().spawnCount() > 0) + app.clearAllObjects(); + else + app.showToast("Nothing to clear"); + } ImGui::Separator(); if (ImGui::MenuItem("Quick Save", "Ctrl+S", false, app.hasTerrainLoaded())) app.quickSave();