added player color initializing
This commit is contained in:
parent
5c53ca9c9c
commit
d7dd8b3223
@ -228,15 +228,6 @@ function onObjectNumberTyped(hoveredObject, playerColor, number)
|
|||||||
-- only continue for decks or cards
|
-- only continue for decks or cards
|
||||||
if hoveredObject.type ~= "Deck" and hoveredObject.type ~= "Card" then return end
|
if hoveredObject.type ~= "Deck" and hoveredObject.type ~= "Card" then return end
|
||||||
|
|
||||||
-- check whether the hovered object is part of a players draw objects
|
|
||||||
for _, color in ipairs(playermatApi.getUsedMatColors()) do
|
|
||||||
local deckAreaObjects = playermatApi.getDeckAreaObjects(color)
|
|
||||||
if deckAreaObjects.topCard == hoveredObject or deckAreaObjects.draw == hoveredObject then
|
|
||||||
playermatApi.drawCardsWithReshuffle(color, number)
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- check if this is a card with states (and then change state instead of drawing it)
|
-- check if this is a card with states (and then change state instead of drawing it)
|
||||||
local states = hoveredObject.getStates()
|
local states = hoveredObject.getStates()
|
||||||
if states ~= nil and #states > 0 then
|
if states ~= nil and #states > 0 then
|
||||||
@ -246,6 +237,15 @@ function onObjectNumberTyped(hoveredObject, playerColor, number)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- check whether the hovered object is part of a players draw objects
|
||||||
|
for _, color in ipairs(playermatApi.getUsedMatColors()) do
|
||||||
|
local deckAreaObjects = playermatApi.getDeckAreaObjects(color)
|
||||||
|
if deckAreaObjects.topCard == hoveredObject or deckAreaObjects.draw == hoveredObject then
|
||||||
|
playermatApi.drawCardsWithReshuffle(color, number)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TTS event, used to redraw the playermat slot symbols after a small delay to account for the custom font loading
|
-- TTS event, used to redraw the playermat slot symbols after a small delay to account for the custom font loading
|
||||||
|
@ -128,6 +128,8 @@ function onLoad(savedData)
|
|||||||
slotData = loadedData.slotData
|
slotData = loadedData.slotData
|
||||||
end
|
end
|
||||||
|
|
||||||
|
updateMessageColor(playerColor)
|
||||||
|
|
||||||
self.interactable = false
|
self.interactable = false
|
||||||
|
|
||||||
-- get object references to owned objects
|
-- get object references to owned objects
|
||||||
|
Loading…
Reference in New Issue
Block a user