From 23111cfb688c5291102c5a61e3c635c8e15baaed Mon Sep 17 00:00:00 2001 From: SpaghettDev <37266659+SpaghettDev@users.noreply.github.com> Date: Tue, 9 Dec 2025 03:56:47 -0500 Subject: [PATCH] add ability to delete nodes --- src/pages/Attributes.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pages/Attributes.cpp b/src/pages/Attributes.cpp index bf8ac1b..7a899a6 100644 --- a/src/pages/Attributes.cpp +++ b/src/pages/Attributes.cpp @@ -69,7 +69,7 @@ void DevTools::drawNodeAttributes(CCNode* node) { } void DevTools::drawBasicAttributes(CCNode* node) { - if (ImGui::Button("Deselect")) { + if (ImGui::Button(U8STR(FEATHER_X_CIRCLE " Deselect"))) { return this->selectNode(nullptr); } ImGui::SameLine(); @@ -101,6 +101,12 @@ void DevTools::drawBasicAttributes(CCNode* node) { fmt::format("{:#x}", reinterpret_cast(node)) ); } + ImGui::SameLine(); + if (ImGui::Button(U8STR(FEATHER_TRASH_2 " Delete"))) { + return node->removeFromParentAndCleanup(true); + } + if (ImGui::IsItemHovered()) + ImGui::SetTooltip("Deleting nodes cannot be undone and may lead to crashes!"); if (node->getUserData()) { ImGui::Text("User data: 0x%p", node->getUserData()); }