Skip to content

Commit 340cad2

Browse files
authored
FEAT: Implement ability to delete folders with contents (#8416)
Lua side code for: PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic#63 Based on: #8197
1 parent 4f25340 commit 340cad2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Classes/BuildListControl.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ end
142142
function BuildListClass:DeleteBuild(build)
143143
if build.folderName then
144144
if NewFileSearch(build.fullFileName.."/*") or NewFileSearch(build.fullFileName.."/*", true) then
145-
main:OpenMessagePopup("Delete Folder", "The folder is not empty.")
145+
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()
146+
RemoveDir(build.fullFileName, true)
147+
self.listMode:BuildList()
148+
self.selIndex = nil
149+
self.selValue = nil
150+
end)
146151
else
147152
local res, msg = RemoveDir(build.fullFileName)
148153
if not res then

0 commit comments

Comments
 (0)