I have clcinfo setup like clcret. And I want all the icons to disappear when I don't have a valid target.
The code looks like this:
Primary skill, big center icon
if UnitExists("target") and UnitCanAttack("player", "target") and not UnitIsDead("target") then
return IconRet1(csBoost)
end
Secondary skill, small icon to the right
if UnitExists("target") and UnitCanAttack("player", "target") and not UnitIsDead("target") then
return IconRet2(csBoost)
end
and some other icons for CDs, etc which are also hidden without a target.
All of these icons work perfectly except for the secondary skill. When I build the icon it is hidden and appears when I take a target. So far so good. But it stays visible afterwards even if I lose the target. Only when I refresh the code or some other option it becomes invisible again, at least until I target an enemy.
When I switch the "return" lines in primary and secondary skill, the big icon is now broken and the small icon works perfectly. So there seems to be a problem in the code for IconRet2() and not in my layout. (Disclaimer: I'm not at all an experienced lua programmer, so it might still be a problem on my side. I just don't have any idea where)