allow changing card state with number typing
This commit is contained in:
parent
e0689dc90c
commit
5a83749631
@ -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
|
||||
|
||||
---------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user