klepto2 Posted October 21, 2023 Share Posted October 21, 2023 I promote this suggestion because: In the latest weeks you made a great progress with the editor, but while testing the editor with lots of files i found some things which could be made easier if a small clear cache function is integrated: Also this function is more or less a very easy one to implemnt. In the latest updates you suggested multiple times to delete the thumbnail folder The overall cache can grow extremely in size and to easily clean it up from the editor would be handy the clear cache should be optionally global or per project 1 Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Josh Posted October 21, 2023 Share Posted October 21, 2023 I am pleased this worked perfectly. Just place this Lua file somewhere in Ultra Engine/Scripts/Start: local extension = {} function extension.NukeDir(path, extension) local files = LoadDir(path) for n = 1, #files do local filepath = path.."/"..files[n] if FileType(filepath) == 2 then extension.NukeDir(filepath, extension) else DeleteFile(filepath) end end DeleteDir(path) end function extension.hook(event, extension) if event.id == EVENT_WIDGETACTION then if event.source == extension.menuitem then local path = GetPath(PATH_PROGRAMDATA).."/Ultra Engine/Thumbnails" if FileType(path) == 2 then extension.NukeDir(path, extension) end Print("Thumbnail cache cleared.") return false end end end -------------------------------------------------------------------- -- Add menu item -------------------------------------------------------------------- local menu = program.menu:FindChild("Scripting", false) if menu == nil then Print("Error: Could not find \"Scripting\" menu.") return end local submenu = menu:FindChild("Utilities", false) if submenu == nil then submenu = CreateMenu("Utilities", menu) end extension.menuitem = CreateMenu("Clear thumbnail cache", submenu) ListenEvent(EVENT_WIDGETACTION, extension.menuitem, extension.hook, extension) 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.