added helper function
This commit is contained in:
parent
7c2bfc36e4
commit
a10041f435
@ -1103,12 +1103,31 @@ function updateDownloadItemList()
|
|||||||
end
|
end
|
||||||
|
|
||||||
contentList.attributes.height = #contentList.children * 27
|
contentList.attributes.height = #contentList.children * 27
|
||||||
UI.setXmlTable(globalXml)
|
updateGlobalXml(globalXml)
|
||||||
|
|
||||||
-- select the first item
|
-- select the first item
|
||||||
Wait.time(onClick_select, 0.2)
|
Wait.time(onClick_select, 0.2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- this helper function updates the global XML while preserving the visibility of windows
|
||||||
|
function updateGlobalXml(newXml)
|
||||||
|
-- preserve visibility settings for these elements
|
||||||
|
local windowIdList = {
|
||||||
|
"playAreaGallery",
|
||||||
|
"downloadWindow",
|
||||||
|
"optionPanel"
|
||||||
|
}
|
||||||
|
|
||||||
|
-- get current state and update newXml
|
||||||
|
for _, windowId in ipairs(windowIdList) do
|
||||||
|
local element = getXmlTableElementById(newXml, windowId)
|
||||||
|
element.attributes.active = UI.getAttribute(windowId, "active")
|
||||||
|
element.attributes.visibility = UI.getAttribute(windowId, "visibility")
|
||||||
|
end
|
||||||
|
|
||||||
|
UI.setXmlTable(newXml)
|
||||||
|
end
|
||||||
|
|
||||||
-- called after the webrequest of downloading an item
|
-- called after the webrequest of downloading an item
|
||||||
-- deletes the placeholder and spawns the downloaded item
|
-- deletes the placeholder and spawns the downloaded item
|
||||||
function contentDownloadCallback(request, params)
|
function contentDownloadCallback(request, params)
|
||||||
|
@ -88,7 +88,7 @@ function updatePlayAreaGallery()
|
|||||||
end
|
end
|
||||||
|
|
||||||
playareaList.attributes.height = round(#playareaList.children / 2, 0) * 380
|
playareaList.attributes.height = round(#playareaList.children / 2, 0) * 380
|
||||||
UI.setXmlTable(globalXml)
|
Global.call("updateGlobalXml", globalXml)
|
||||||
Wait.time(highlightTabAndItem, 0.1)
|
Wait.time(highlightTabAndItem, 0.1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user