trash handling

This commit is contained in:
Chr1Z93 2024-11-21 00:40:12 +01:00
parent 338da36748
commit 2977e278ec
2 changed files with 18 additions and 0 deletions

View File

@ -2933,6 +2933,10 @@ function stopTokenTransformUpdating(card)
card.use_hands = true card.use_hands = true
end end
function unregisterCard(card)
cardTokens[card] = nil
end
function unregisterTokenFromCard(params) function unregisterTokenFromCard(params)
local card = params.card local card = params.card
local token = params.token local token = params.token

View File

@ -9,3 +9,17 @@ function emptyTrash()
self.takeObject().destruct() self.takeObject().destruct()
end end
end end
function onObjectLeaveContainer(container, object)
if container == self then
object.locked = false
if object.type == "Card" then
object.use_hands = true
end
if object.type == "Card" or object.type == "Deck" then
Global.call("unregisterCard", object)
end
end
end