Merge pull request #745 from argonui/messagecolor

Updated Playermat
This commit is contained in:
dscarpac 2024-07-04 17:30:20 -05:00 committed by GitHub
commit 32b920f800
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 9 deletions

View File

@ -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

View File

@ -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