Fix color handling in setExpression()
This commit is contained in:
parent
7b51269f8b
commit
fa7aab7f1d
@ -768,17 +768,20 @@ do
|
|||||||
function setExpression(expression)
|
function setExpression(expression)
|
||||||
current_expression=expression
|
current_expression=expression
|
||||||
FACE.setUV(expruvm:getUV(current_expression))
|
FACE.setUV(expruvm:getUV(current_expression))
|
||||||
setColor(COLORS[current_expression])
|
-- This expression sticks, so do not set color explicitly
|
||||||
|
setColor()
|
||||||
end
|
end
|
||||||
function changeExpression(expression, ticks)
|
function changeExpression(expression, ticks)
|
||||||
FACE.setUV(expruvm:getUV(expression))
|
FACE.setUV(expruvm:getUV(expression))
|
||||||
|
-- This one is for more explicit "flashes" such as player hurt
|
||||||
|
-- animations, get color explicitly
|
||||||
setColor(COLORS[expression])
|
setColor(COLORS[expression])
|
||||||
namedWait(ticks, resetExpression, "resetExpression")
|
namedWait(ticks, resetExpression, "resetExpression")
|
||||||
end
|
end
|
||||||
function resetExpression()
|
function resetExpression()
|
||||||
lock_color=false
|
lock_color=false
|
||||||
FACE.setUV(expruvm:getUV(current_expression))
|
FACE.setUV(expruvm:getUV(current_expression))
|
||||||
setColor(getBestColor())
|
setColor()
|
||||||
end
|
end
|
||||||
|
|
||||||
function hurt()
|
function hurt()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user