Let the Card Back Enhancer also update the "BackIsHidden" setting

This commit is contained in:
Chr1Z93 2024-08-05 00:05:29 +02:00
parent a3f7cd9770
commit b915312056

View File

@ -31,6 +31,7 @@ function onCollisionEnter(collisionInfo)
for customDeckId, customDeckData in pairs(data["CustomDeck"]) do
if deckChanges[customDeckId] then
customDeckData["BackURL"] = deckChanges[customDeckId]
customDeckData["BackIsHidden"] = true
end
end
end
@ -67,12 +68,13 @@ function processCard(cardData)
local customDeckId, customDeckData = next(cardData["CustomDeck"])
-- if this card already has the correct back
if customDeckData["BackURL"] == newBack then return false end
-- if this card already has the correct back settings
if customDeckData["BackURL"] == newBack and customDeckData["BackIsHidden"] then return false end
-- skip cards with decksheets as back
if (customDeckData["NumHeight"] == 1 and customDeckData["NumWidth"] == 1)
or customDeckData["UniqueBack"] == false then
customDeckData["BackIsHidden"] = true
customDeckData["BackURL"] = newBack
deckChanges[customDeckId] = newBack
end