From d402565dcce3faaa89f29d1af9ba5a43aaba2b5f Mon Sep 17 00:00:00 2001 From: Paliak <91493239+Paliak@users.noreply.github.com> Date: Sun, 19 Jan 2025 20:10:36 +0100 Subject: [PATCH] FEAT: Implement ability to delete folders with contents Lua side code for: https://github.com/PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic/pull/63 Based on: https://github.com/PathOfBuildingCommunity/PathOfBuilding/pull/8197 --- src/Classes/BuildListControl.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Classes/BuildListControl.lua b/src/Classes/BuildListControl.lua index c1bec7f923..3f42430ce9 100644 --- a/src/Classes/BuildListControl.lua +++ b/src/Classes/BuildListControl.lua @@ -142,7 +142,12 @@ end function BuildListClass:DeleteBuild(build) if build.folderName then if NewFileSearch(build.fullFileName.."/*") or NewFileSearch(build.fullFileName.."/*", true) then - main:OpenMessagePopup("Delete Folder", "The folder is not empty.") + main:OpenConfirmPopup("Confirm Folder Delete", "The folder is not empty.\nAre you sure you want to delete folder:\n"..build.folderName.."\nThis cannot be undone.", "Delete", function() + RemoveDir(build.fullFileName, true) + self.listMode:BuildList() + self.selIndex = nil + self.selValue = nil + end) else local res, msg = RemoveDir(build.fullFileName) if not res then