allow changing card state with number typing

This commit is contained in:
Chr1Z93 2024-04-18 19:42:42 +02:00
parent e0689dc90c
commit 5a83749631

View File

@ -211,6 +211,16 @@ function onObjectNumberTyped(hoveredObject, playerColor, number)
return true
end
end
-- check if this is a card with states (and then change state instead of drawing it)
local states = hoveredObject.getStates()
if states ~= nil and #states > 0 then
local stateId = hoveredObject.getStateId()
if stateId ~= number and (#states + 1) >= number then
hoveredObject.setState(number)
return true
end
end
end
---------------------------------------------------------