Hello. I try to follow this tutorial:
http://wiki.esoui.com/Writing_your_first_addon
And I create a function like that:
Lua Code:
function testplugin.OnPlayerCombatState(event, inCombat)
-- The ~= operator is "not equal to" in Lua.
if inCombat ~= testplugin.inCombat then
-- The player's state has changed. Update the stored state...
testplugin.inCombat = inCombat
-- ...and then update the control.
testpluginIndicator:SetHidden(not inCombat)
end
end
But something went wrong, because when I reload UI, it already show me "
Fighting!" sign. But I'm not in combat state! After killing the enemy, the sign disappears. But why It exists without fight mode just after reloadui? Why inCombat variable return 1?
For example,
Lua Code:
if inCombat then
d("Entering combat.")
else
d("Exiting combat.")
end
works perfectly - it shows me Entering/Exiting when it really occurs.