Merge pull request #244 from argonui/sideways-decks
Add alt view angle for sideways decks
This commit is contained in:
commit
566fe72327
@ -78,10 +78,10 @@ end
|
|||||||
|
|
||||||
-- Spawn a specific list of cards. This method is for internal use and should not be called
|
-- Spawn a specific list of cards. This method is for internal use and should not be called
|
||||||
-- directly, use spawnCards instead.
|
-- directly, use spawnCards instead.
|
||||||
-- @param cardList: A list of Player Card data structures (data/metadata)
|
---@param cardList: A list of Player Card data structures (data/metadata)
|
||||||
-- @param pos Position table where the cards should be spawned (global)
|
---@param pos table Position where the cards should be spawned (global)
|
||||||
-- @param rot Rotation table for the orientation of the spawned cards (global)
|
---@param rot table Rotation for the orientation of the spawned cards (global)
|
||||||
-- @param callback Function, callback to be called after the card/deck spawns.
|
---@param callback function callback to be called after the card/deck spawns.
|
||||||
Spawner.spawn = function(cardList, pos, rot, callback)
|
Spawner.spawn = function(cardList, pos, rot, callback)
|
||||||
if (#cardList == 0) then
|
if (#cardList == 0) then
|
||||||
return
|
return
|
||||||
@ -105,8 +105,15 @@ Spawner.spawn = function(cardList, pos, rot, callback)
|
|||||||
scaleY = 1,
|
scaleY = 1,
|
||||||
scaleZ = cardList[1].data.Transform.scaleZ,
|
scaleZ = cardList[1].data.Transform.scaleZ,
|
||||||
}
|
}
|
||||||
|
local sidewaysDeck = true
|
||||||
for _, spawnCard in ipairs(cardList) do
|
for _, spawnCard in ipairs(cardList) do
|
||||||
Spawner.addCardToDeck(deck, spawnCard.data)
|
Spawner.addCardToDeck(deck, spawnCard.data)
|
||||||
|
-- set sidewaysDeck to false if any card is not a sideways card
|
||||||
|
sidewaysDeck = (sidewaysDeck and spawnCard.data.SidewaysCard)
|
||||||
|
end
|
||||||
|
-- set the alt view angle for sideway decks
|
||||||
|
if sidewaysDeck then
|
||||||
|
deck.AltLookAngle = { x = 0, y = 180, z = 90 }
|
||||||
end
|
end
|
||||||
spawnObjectData({
|
spawnObjectData({
|
||||||
data = deck,
|
data = deck,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user