Untitled

 avatar
unknown
plain_text
3 years ago
717 B
5
Indexable
local stance = CreateFrame("Frame")
stance:RegisterEvent("PLAYER_LOGIN")
stance:RegisterEvent("SPELLS_CHANGED")
stance.Icon = stance:CreateTexture(nil,"ARTWORK")
stance.Icon:SetScale(0.5)
stance.Icon:SetPoint("LEFT", UIParent, "CENTER", -195, -121)
  
stance:SetScript("OnEvent", function(self, event, ...)
        if event == ("SPELLS_CHANGED") or event == ("PLAYER_LOGIN") then 
		local isdefstance = GetPlayerAuraBySpellID(197690)
        if isdefstance and self.Icon:GetTexture() ~= 132341 then 
                  self.Icon:SetTexture(132341)
        elseif not isdefstance and self.Icon:GetTexture() ~= 132349 then	
                  self.Icon:SetTexture(132349)  
        end	
        end		
end)
Editor is loading...