SHARE
TWEET

Untitled

a guest Sep 20th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function (self, unitId, unitFrame, envTable)
  2.    
  3.     --settings:
  4.     --show cast icon
  5.     envTable.ShowIcon = true
  6.     --anchor icon on what side
  7.     envTable.IconAnchor = "right" --accep 'left' 'right'
  8.     --fine tune the size of the icon
  9.     envTable.IconSizeOffset = 1
  10.    
  11.     --shield for non interruptible casts
  12.     envTable.ShowShield = true
  13.     envTable.ShieldTexture = [[Interface\GROUPFRAME\UI-GROUP-MAINTANKICON]]
  14.     envTable.ShieldDesaturated = true
  15.     envTable.ShieldColor = {1, 1, 1 ,1}
  16.     envTable.ShieldSize = {10, 12}
  17.    
  18.     --private:
  19.     function envTable.UpdateIconPosition (unitFrame)
  20.         local castBar = unitFrame.castBar
  21.         local icon = castBar.Icon
  22.         local shield = castBar.BorderShield
  23.        
  24.         if (envTable.ShowIcon) then
  25.             icon:ClearAllPoints()
  26.            
  27.             if (envTable.IconAnchor == "left") then
  28.                 icon:SetPoint ("topright", unitFrame.healthBar, "topleft", -1, envTable.IconSizeOffset)
  29.                 icon:SetPoint ("bottomright", unitFrame.castBar, "bottomleft", -1, 0)    
  30.                
  31.             elseif (envTable.IconAnchor == "right") then
  32.                 icon:SetPoint ("topleft", unitFrame.healthBar, "topright", 1, envTable.IconSizeOffset)
  33.                 icon:SetPoint ("bottomleft", unitFrame.castBar, "bottomright", 1, 0)
  34.                
  35.             end
  36.            
  37.             icon:SetWidth (icon:GetHeight())
  38.             icon:Show()
  39.            
  40.         else
  41.             icon:Hide()
  42.            
  43.         end
  44.        
  45.         if (envTable.ShowShield and not castBar.canInterrupt) then
  46.             shield:Show()
  47.             shield:SetAlpha (1)
  48.             shield:SetTexCoord (0, 1, 0, 1)
  49.             shield:SetVertexColor (1, 1, 1, 1)
  50.            
  51.             shield:SetTexture (envTable.ShieldTexture)
  52.             shield:SetDesaturated (envTable.ShieldDesaturated)
  53.            
  54.             if (not envTable.ShieldDesaturated) then
  55.                 shield:SetVertexColor (DetailsFramework:ParseColors (envTable.ShieldColor))
  56.             end
  57.            
  58.             shield:SetSize (unpack (envTable.ShieldSize))
  59.            
  60.             shield:ClearAllPoints()
  61.             shield:SetPoint ("center", castBar, "left", 0, 0)
  62.            
  63.         else
  64.             shield:Hide()
  65.            
  66.         end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top