Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function (self, unitId, unitFrame, envTable)
- --settings:
- --show cast icon
- envTable.ShowIcon = true
- --anchor icon on what side
- envTable.IconAnchor = "right" --accep 'left' 'right'
- --fine tune the size of the icon
- envTable.IconSizeOffset = 1
- --shield for non interruptible casts
- envTable.ShowShield = true
- envTable.ShieldTexture = [[Interface\GROUPFRAME\UI-GROUP-MAINTANKICON]]
- envTable.ShieldDesaturated = true
- envTable.ShieldColor = {1, 1, 1 ,1}
- envTable.ShieldSize = {10, 12}
- --private:
- function envTable.UpdateIconPosition (unitFrame)
- local castBar = unitFrame.castBar
- local icon = castBar.Icon
- local shield = castBar.BorderShield
- if (envTable.ShowIcon) then
- icon:ClearAllPoints()
- if (envTable.IconAnchor == "left") then
- icon:SetPoint ("topright", unitFrame.healthBar, "topleft", -1, envTable.IconSizeOffset)
- icon:SetPoint ("bottomright", unitFrame.castBar, "bottomleft", -1, 0)
- elseif (envTable.IconAnchor == "right") then
- icon:SetPoint ("topleft", unitFrame.healthBar, "topright", 1, envTable.IconSizeOffset)
- icon:SetPoint ("bottomleft", unitFrame.castBar, "bottomright", 1, 0)
- end
- icon:SetWidth (icon:GetHeight())
- icon:Show()
- else
- icon:Hide()
- end
- if (envTable.ShowShield and not castBar.canInterrupt) then
- shield:Show()
- shield:SetAlpha (1)
- shield:SetTexCoord (0, 1, 0, 1)
- shield:SetVertexColor (1, 1, 1, 1)
- shield:SetTexture (envTable.ShieldTexture)
- shield:SetDesaturated (envTable.ShieldDesaturated)
- if (not envTable.ShieldDesaturated) then
- shield:SetVertexColor (DetailsFramework:ParseColors (envTable.ShieldColor))
- end
- shield:SetSize (unpack (envTable.ShieldSize))
- shield:ClearAllPoints()
- shield:SetPoint ("center", castBar, "left", 0, 0)
- else
- shield:Hide()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement