Inverted alpha settings for custom counters watching spell charges

For charges, being full is the default state, so we need to treat full the same as health or mana being full. (ticket #231)
Also fixed the "target" variable never getting set on custom counters or custom counter bars because they were overriding the PLAYER_TARGET_CHANGED event that the base class was registering.
Also also fixed numeric display mode for custom counters not using the correct gradient scaling when the number hit 0. It was using the same scaling as graphical mode where 0 displays nothing and needs to be accounted for separately.
This commit is contained in:
Parnic
2016-12-07 23:28:44 -06:00
parent 49f8a6c6b2
commit ce1558a18e
3 changed files with 24 additions and 4 deletions

View File

@ -130,7 +130,6 @@ function IceStackCounter_Enable(frame)
frame:RegisterEvent("UNIT_PET", "UpdateCustomCount")
frame:RegisterEvent("PLAYER_PET_CHANGED", "UpdateCustomCount")
frame:RegisterEvent("PLAYER_FOCUS_CHANGED", "UpdateCustomCount")
frame:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateCustomCount")
frame:RegisterEvent("PLAYER_DEAD", "UpdateCustomCount")
frame:RegisterEvent("SPELL_UPDATE_CHARGES", "UpdateCustomCount")
@ -171,5 +170,9 @@ function IceStackCounter_GetCount(frame)
end
function IceStackCounter_UseTargetAlpha(frame)
return frame.lastPoints ~= nil and frame.lastPoints > 0
if frame.moduleSettings.auraType == "charges" then
return IceStackCounter_GetCount(frame) ~= IceStackCounter_GetMaxCount(frame) or frame.target or frame.combat
else
return frame.lastPoints ~= nil and frame.lastPoints > 0
end
end