Merge pull request #494 from argonui/deckimport
Added missing tag to imported decks
This commit is contained in:
commit
10cc3d2fe8
@ -154,6 +154,7 @@ function deckSpawned(deck, playerColor)
|
|||||||
local player = Player[playmatApi.getPlayerColor(playerColor)]
|
local player = Player[playmatApi.getPlayerColor(playerColor)]
|
||||||
local handPos = player.getHandTransform(1).position -- Only one hand zone per player
|
local handPos = player.getHandTransform(1).position -- Only one hand zone per player
|
||||||
local deckCards = deck.getData().ContainedObjects
|
local deckCards = deck.getData().ContainedObjects
|
||||||
|
|
||||||
-- Process in reverse order so taking cards out doesn't upset the indexing
|
-- Process in reverse order so taking cards out doesn't upset the indexing
|
||||||
for i = #deckCards, 1, -1 do
|
for i = #deckCards, 1, -1 do
|
||||||
local cardMetadata = JSON.decode(deckCards[i].GMNotes) or { }
|
local cardMetadata = JSON.decode(deckCards[i].GMNotes) or { }
|
||||||
@ -161,6 +162,11 @@ function deckSpawned(deck, playerColor)
|
|||||||
deck.takeObject({ index = i - 1, position = handPos, flip = true, smooth = true})
|
deck.takeObject({ index = i - 1, position = handPos, flip = true, smooth = true})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- add the "PlayerCard" tag to the deck
|
||||||
|
if deck and deck.type == "Deck" and deck.getQuantity() > 1 then
|
||||||
|
deck.addTag("PlayerCard")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Converts the Raven Quill's selections from card IDs to card names. This could be more elegant
|
-- Converts the Raven Quill's selections from card IDs to card names. This could be more elegant
|
||||||
|
Loading…
x
Reference in New Issue
Block a user