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:
@ -1 +1,5 @@
|
||||
require("loading")
|
||||
|
||||
if (Engine.InFrontend()) then
|
||||
require("download")
|
||||
end
|
||||
|
13
data/cdata/ui_scripts/mods/download.lua
Normal file
13
data/cdata/ui_scripts/mods/download.lua
Normal 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)
|
Reference in New Issue
Block a user