Advertisement
alexdubovyck

Кнопка(иконка) меняется 1 на 2. 2 на 1

Jan 14th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. ---------------------------------------------
  2. -- Лапа
  3. ---------------------------------------------
  4. if not iduh then
  5.  
  6. local f = CreateFrame("Button", nil, UIParent, "UIPanelButtonTemplate")
  7. f:SetParent(MultiBarBottomLeftButton12)
  8. f:SetPoint("CENTER", 0, 0)
  9. f:SetSize(38, 38)
  10. f:RegisterForClicks("AnyDown")
  11. -- f:SetText("Духи!")
  12.  
  13. local ptex = f:CreateTexture()
  14. ptex:SetTexture("Interface/Icons/Spell_Magic_GreaterBlessingofKings")
  15. ptex:SetTexCoord(0, 1, 0, 1)
  16. ptex:SetAllPoints()
  17. f:SetNormalTexture(ptex)
  18. DUHI = 1
  19.  
  20. local ftex = f:CreateTexture()
  21. ftex:SetTexture("Interface/Icons/Spell_Holy_GreaterBlessingofKings")
  22. ftex:SetTexCoord(0, 1, 0, 1)
  23. ftex:SetAllPoints()
  24. f:SetNormalTexture(ftex)
  25. -- f:SetPushedTexture(ftex)
  26.  
  27. f:SetScript("OnClick", function()
  28. if DUHI == 1 then
  29. DUHI = 2
  30. f:SetNormalTexture("Interface/Icons/Spell_Magic_GreaterBlessingofKings")
  31. else
  32. DUHI = 1
  33. f:SetNormalTexture("Interface/Icons/Spell_Holy_GreaterBlessingofKings")
  34. end
  35. end)
  36.  
  37. iduh = true end
  38.  
  39. if DUHI == 1 and not UnitBuff("player", GetSpellInfo(79062)) then
  40. -- Cast("Дух ястреба")
  41. end
  42. if DUHI == 2 and not UnitBuff("player", GetSpellInfo(79101)) then
  43. -- Cast("Дух гепарда")
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement