Merge branch 'main' into onload-improvements

This commit is contained in:
Chr1Z93 2024-03-25 17:36:08 +01:00
commit 771f3f07fa
4 changed files with 8 additions and 5 deletions

View File

@ -2,6 +2,7 @@
"id": "09123",
"type": "Asset",
"class": "Neutral",
"startsInPlay": true,
"level": 3,
"traits": "Ritual.",
"permanent": true,

View File

@ -2,6 +2,6 @@ function onLoad()
self.addContextMenuItem("Download", download)
end
function download()
Global.call('placeholder_download', { url = self.getGMNotes(), replace = self.guid })
function download(_, playerColor)
Global.call('placeholder_download', { url = self.getGMNotes(), player = Player[playerColor], replace = self.guid })
end

View File

@ -37,5 +37,5 @@ function onLoad()
end
function buttonClick_download(_, playerColor)
Global.call('placeholder_download', { url = self.getGMNotes(), player = Player[playerColor], replace = self.guid })
Global.call('placeholder_download', { url = self.getGMNotes(), player = playerColor and Player[playerColor] or nil, replace = self.guid })
end

View File

@ -40,7 +40,7 @@ local bagSearchers = {}
local hideTitleSplashWaitFunctionId = nil
-- online functionality related variables
local MOD_VERSION = "3.6.0"
local MOD_VERSION = "3.7.0"
local SOURCE_REPO = 'https://raw.githubusercontent.com/chr1z93/loadable-objects/main'
local library, requestObj, modMeta
local acknowledgedUpgradeVersions = {}
@ -783,7 +783,9 @@ function placeholder_download(params)
UI.setAttribute('download_progress', 'active', false)
-- hide download window
changeWindowVisibilityForColor(params.player.color, "downloadWindow", false)
if params.player then
changeWindowVisibilityForColor(params.player.color, "downloadWindow", false)
end
return 1
end