additional trigger of save function
This commit is contained in:
parent
ccda7d7592
commit
6c7f269b10
@ -127,10 +127,7 @@ function onDrop(playerColor)
|
|||||||
for _, bgInfo in ipairs(BACKGROUNDS) do
|
for _, bgInfo in ipairs(BACKGROUNDS) do
|
||||||
if bgInfo.title == syncName then
|
if bgInfo.title == syncName then
|
||||||
printToColor("Background for '" .. syncName .. "' loaded!", playerColor, "Green")
|
printToColor("Background for '" .. syncName .. "' loaded!", playerColor, "Green")
|
||||||
local customInfo = self.getCustomObject()
|
updateImage(bgInfo.url)
|
||||||
customInfo.diffuse = bgInfo.url
|
|
||||||
self.setCustomObject(customInfo)
|
|
||||||
self.reload()
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -147,13 +144,19 @@ function selectImage(color)
|
|||||||
|
|
||||||
-- prompt user to select option
|
-- prompt user to select option
|
||||||
Player[color].showOptionsDialog("Select image:", options, 1, function(_, optionIndex)
|
Player[color].showOptionsDialog("Select image:", options, 1, function(_, optionIndex)
|
||||||
local customInfo = self.getCustomObject()
|
updateImage(BACKGROUNDS[optionIndex].url)
|
||||||
customInfo.diffuse = BACKGROUNDS[optionIndex].url
|
|
||||||
self.setCustomObject(customInfo)
|
|
||||||
self.reload()
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- sets background to the provided URL
|
||||||
|
function updateImage(url)
|
||||||
|
self.script_state = JSON.encode({ cardsInBag, showCost, showIcons })
|
||||||
|
local customInfo = self.getCustomObject()
|
||||||
|
customInfo.diffuse = url
|
||||||
|
self.setCustomObject(customInfo)
|
||||||
|
self.reload()
|
||||||
|
end
|
||||||
|
|
||||||
-- only allow cards to enter, split decks and reject other objects
|
-- only allow cards to enter, split decks and reject other objects
|
||||||
function onObjectEnterContainer(container, object)
|
function onObjectEnterContainer(container, object)
|
||||||
if container ~= self then return end
|
if container ~= self then return end
|
||||||
|
Loading…
Reference in New Issue
Block a user