h1-mod/data/cdata/ui_scripts/mods/download.lua
m 6d2a5bf5bc Mod downloading (#228)
* basic template for mod downloading

* better checks for unloading?

* Mod download stuff

* debug prints

* basic UI popup for mod downloading

* change notify location + abort download

* Prevent mods from loading lua files

* cleanup, fixes, mod aborting

* use correct pipelines

* change some messages

* fix mod downloading

* not a component

* fix hardcoded changes

Co-authored-by: Federico Cecchetto <fedecek3@gmail.com>
2022-09-11 08:09:50 -05:00

14 lines
459 B
Lua

Engine.GetLuiRoot():registerEventHandler("mod_download_start", function(element, event)
local popup = LUI.openpopupmenu("generic_waiting_popup_", {
oncancel = function()
download.abort()
end,
withcancel = true,
text = "Downloading " .. event.request.name .. "..."
})
Engine.GetLuiRoot():registerEventHandler("mod_download_done", function()
LUI.FlowManager.RequestLeaveMenu(popup)
end)
end)