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>
This commit is contained in:
m
2022-09-11 08:07:19 -05:00
parent b48e47d244
commit 6d2a5bf5bc
12 changed files with 369 additions and 28 deletions

View File

@ -1 +1,5 @@
require("loading")
if (Engine.InFrontend()) then
require("download")
end

View File

@ -0,0 +1,13 @@
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)