Advertisement
Guest User

Untitled

a guest
Aug 13th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.00 KB | None | 0 0
  1. commit f9685664847fbca1cc2539ac1f60d140176e7cdf
  2. Author: Infus <infus@squorn.de>
  3. Date:   Sat Aug 13 20:47:31 2016 +0200
  4.  
  5.     Make LibButtonGlow accept a frameName
  6.    
  7.     So that multiple addons can safely use LibButtonGlow on the same
  8.     button.
  9.  
  10. diff --git a/WeakAuras/libs/LibButtonGlow-1.0/LibButtonGlow-1.0.lua b/WeakAuras/libs/LibButtonGlow-1.0/LibButtonGlow-1.0.lua
  11. index 0c764da..5568ba6 100644
  12. --- a/WeakAuras/libs/LibButtonGlow-1.0/LibButtonGlow-1.0.lua
  13. +++ b/WeakAuras/libs/LibButtonGlow-1.0/LibButtonGlow-1.0.lua
  14. @@ -28,7 +28,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  15.  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16.  ]]
  17.  local MAJOR_VERSION = "LibButtonGlow-1.0"
  18. -local MINOR_VERSION = 6
  19. +local MINOR_VERSION = 7
  20.  
  21.  if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
  22.  local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
  23. @@ -46,7 +46,10 @@ local function OverlayGlowAnimOutFinished(animGroup)
  24.     local frame = overlay:GetParent()
  25.     overlay:Hide()
  26.     tinsert(lib.unusedOverlays, overlay)
  27. -   frame.__LBGoverlay = nil
  28. +   local frameName = overlay.frameName;
  29. +   overlay.frameName = nil;
  30. +
  31. +   frame[frameName] = nil
  32.  end
  33.  
  34.  local function OverlayGlow_OnHide(self)
  35. @@ -201,11 +204,12 @@ local function GetOverlayGlow()
  36.     return overlay
  37.  end
  38.  
  39. -function lib.ShowOverlayGlow(frame)
  40. -   if frame.__LBGoverlay then
  41. -       if frame.__LBGoverlay.animOut:IsPlaying() then
  42. -           frame.__LBGoverlay.animOut:Stop()
  43. -           frame.__LBGoverlay.animIn:Play()
  44. +function lib.ShowOverlayGlow(frame, frameName)
  45. +   frameName = frameName or "__LBGoverlay"
  46. +   if frame[frameName] then
  47. +       if frame[frameName].animOut:IsPlaying() then
  48. +           frame[frameName].animOut:Stop()
  49. +           frame[frameName].animIn:Play()
  50.         end
  51.     else
  52.         local overlay = GetOverlayGlow()
  53. @@ -218,7 +222,8 @@ function lib.ShowOverlayGlow(frame)
  54.         overlay:SetPoint("TOPLEFT", frame, "TOPLEFT", -frameWidth * 0.2, frameHeight * 0.2)
  55.         overlay:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", frameWidth * 0.2, -frameHeight * 0.2)
  56.         overlay.animIn:Play()
  57. -       frame.__LBGoverlay = overlay
  58. +       frame[frameName] = overlay
  59. +       overlay.frameName = frameName
  60.  
  61.         if Masque and Masque.UpdateSpellAlert and (not frame.overlay or not issecurevariable(frame, "overlay")) then
  62.             local old_overlay = frame.overlay
  63. @@ -230,15 +235,16 @@ function lib.ShowOverlayGlow(frame)
  64.     end
  65.  end
  66.  
  67. -function lib.HideOverlayGlow(frame)
  68. -   if frame.__LBGoverlay then
  69. -       if frame.__LBGoverlay.animIn:IsPlaying() then
  70. -           frame.__LBGoverlay.animIn:Stop()
  71. +function lib.HideOverlayGlow(frame, frameName)
  72. +   frameName = frameName or "__LBGoverlay"
  73. +   if frame[frameName] then
  74. +       if frame[frameName].animIn:IsPlaying() then
  75. +           frame[frameName].animIn:Stop()
  76.         end
  77.         if frame:IsVisible() then
  78. -           frame.__LBGoverlay.animOut:Play()
  79. +           frame[frameName].animOut:Play()
  80.         else
  81. -           OverlayGlowAnimOutFinished(frame.__LBGoverlay.animOut)
  82. +           OverlayGlowAnimOutFinished(frame[frameName].animOut)
  83.         end
  84.     end
  85.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement