Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit f9685664847fbca1cc2539ac1f60d140176e7cdf
- Author: Infus <infus@squorn.de>
- Date: Sat Aug 13 20:47:31 2016 +0200
- Make LibButtonGlow accept a frameName
- So that multiple addons can safely use LibButtonGlow on the same
- button.
- diff --git a/WeakAuras/libs/LibButtonGlow-1.0/LibButtonGlow-1.0.lua b/WeakAuras/libs/LibButtonGlow-1.0/LibButtonGlow-1.0.lua
- index 0c764da..5568ba6 100644
- --- a/WeakAuras/libs/LibButtonGlow-1.0/LibButtonGlow-1.0.lua
- +++ b/WeakAuras/libs/LibButtonGlow-1.0/LibButtonGlow-1.0.lua
- @@ -28,7 +28,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- ]]
- local MAJOR_VERSION = "LibButtonGlow-1.0"
- -local MINOR_VERSION = 6
- +local MINOR_VERSION = 7
- if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
- local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
- @@ -46,7 +46,10 @@ local function OverlayGlowAnimOutFinished(animGroup)
- local frame = overlay:GetParent()
- overlay:Hide()
- tinsert(lib.unusedOverlays, overlay)
- - frame.__LBGoverlay = nil
- + local frameName = overlay.frameName;
- + overlay.frameName = nil;
- +
- + frame[frameName] = nil
- end
- local function OverlayGlow_OnHide(self)
- @@ -201,11 +204,12 @@ local function GetOverlayGlow()
- return overlay
- end
- -function lib.ShowOverlayGlow(frame)
- - if frame.__LBGoverlay then
- - if frame.__LBGoverlay.animOut:IsPlaying() then
- - frame.__LBGoverlay.animOut:Stop()
- - frame.__LBGoverlay.animIn:Play()
- +function lib.ShowOverlayGlow(frame, frameName)
- + frameName = frameName or "__LBGoverlay"
- + if frame[frameName] then
- + if frame[frameName].animOut:IsPlaying() then
- + frame[frameName].animOut:Stop()
- + frame[frameName].animIn:Play()
- end
- else
- local overlay = GetOverlayGlow()
- @@ -218,7 +222,8 @@ function lib.ShowOverlayGlow(frame)
- overlay:SetPoint("TOPLEFT", frame, "TOPLEFT", -frameWidth * 0.2, frameHeight * 0.2)
- overlay:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", frameWidth * 0.2, -frameHeight * 0.2)
- overlay.animIn:Play()
- - frame.__LBGoverlay = overlay
- + frame[frameName] = overlay
- + overlay.frameName = frameName
- if Masque and Masque.UpdateSpellAlert and (not frame.overlay or not issecurevariable(frame, "overlay")) then
- local old_overlay = frame.overlay
- @@ -230,15 +235,16 @@ function lib.ShowOverlayGlow(frame)
- end
- end
- -function lib.HideOverlayGlow(frame)
- - if frame.__LBGoverlay then
- - if frame.__LBGoverlay.animIn:IsPlaying() then
- - frame.__LBGoverlay.animIn:Stop()
- +function lib.HideOverlayGlow(frame, frameName)
- + frameName = frameName or "__LBGoverlay"
- + if frame[frameName] then
- + if frame[frameName].animIn:IsPlaying() then
- + frame[frameName].animIn:Stop()
- end
- if frame:IsVisible() then
- - frame.__LBGoverlay.animOut:Play()
- + frame[frameName].animOut:Play()
- else
- - OverlayGlowAnimOutFinished(frame.__LBGoverlay.animOut)
- + OverlayGlowAnimOutFinished(frame[frameName].animOut)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement