From 2189cf83af785f9facf426e580ce1c6cfb43c6e6 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 19 Oct 2023 18:47:19 +0200 Subject: [PATCH] download everything WIP --- src/core/Global.ttslua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index b7ba459b..0236fc55 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -719,7 +719,43 @@ end -- spawns a bag that contains every object from the library function onClick_downloadAll() + startLuaCoroutine(Global, "multiDownload") +end +function multiDownload() + local data = { + Name = "Bag", + Nickname = "All Downloadable Content", + Transform = { + posX = -39.5, + posY = 2, + posZ = -87, + rotX = 0, + rotY = 270, + rotZ = 0, + scaleX = 1, + scaleY = 1, + scaleZ = 1 + }, + ContainedObjects = {} + } + + -- loop through the library to add content + --for contentType, objectList in pairs(library) do + --for _, params in ipairs(objectList) do + local params = library[contentToShow][currentListItem] + WebRequest.get(SOURCE_REPO .. '/' .. params.url, function (request) + table.insert(data.ContainedObjects, request.text) + spawnObjectData({data = data}) -- need spawnObjectJson + end) + --end + --end + + -- hide download window + if xmlVisibility.downloadWindow then + xmlVisibility.downloadWindow = false + UI.hide('downloadWindow') + end end -- spawns a placeholder box for the selected object