From b2074a7bdc55fa34aad76da190c5d1acffe6ecb4 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Fri, 9 Sep 2016 17:03:49 +0300 Subject: [PATCH] Attempting to prevent script ran too long in link detection while in combat --- ElvUI_SLE/modules/chat/links.lua | 42 ++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/ElvUI_SLE/modules/chat/links.lua b/ElvUI_SLE/modules/chat/links.lua index ec6eed5..7fdd779 100644 --- a/ElvUI_SLE/modules/chat/links.lua +++ b/ElvUI_SLE/modules/chat/links.lua @@ -164,30 +164,32 @@ function C:ParseChatEventInv(event, msg, sender, ...) end function C:SetItemRef(link, text, button, chatframe) - local linktype, id = T.split(":", link) - if C.db.dpsSpam then - if linktype == "SLD" then - local meterID = T.tonumber(id) - -- put stuff in the ItemRefTooltip from FrameXML - ShowUIPanel(ItemRefTooltip); - if ( not ItemRefTooltip:IsShown() ) then - ItemRefTooltip:SetOwner(UIParent, "ANCHOR_PRESERVE"); + if not T.InCombatLockdown() then + local linktype, id = T.split(":", link) + if C.db.dpsSpam then + if linktype == "SLD" then + local meterID = T.tonumber(id) + -- put stuff in the ItemRefTooltip from FrameXML + ShowUIPanel(ItemRefTooltip); + if ( not ItemRefTooltip:IsShown() ) then + ItemRefTooltip:SetOwner(UIParent, "ANCHOR_PRESERVE"); + end + ItemRefTooltip:ClearLines() + ItemRefTooltip:AddLine(C.Meters[meterID].title) + ItemRefTooltip:AddLine(T.format(L["Reported by %s"],C.Meters[meterID].src)) + for _,message in T.ipairs(C.Meters[meterID].data) do ItemRefTooltip:AddLine(message,1,1,1) end + ItemRefTooltip:Show() + return nil end - ItemRefTooltip:ClearLines() - ItemRefTooltip:AddLine(C.Meters[meterID].title) - ItemRefTooltip:AddLine(T.format(L["Reported by %s"],C.Meters[meterID].src)) - for _,message in T.ipairs(C.Meters[meterID].data) do ItemRefTooltip:AddLine(message,1,1,1) end - ItemRefTooltip:Show() + end + if IsAltKeyDown() and linktype == "player" and E.db.sle.chat.invite.altInv then + InviteUnit(id) + return nil + elseif linktype == "invite" then + InviteUnit(id) return nil end end - if IsAltKeyDown() and linktype == "player" and E.db.sle.chat.invite.altInv then - InviteUnit(id) - return nil - elseif linktype == "invite" then - InviteUnit(id) - return nil - end return self.hooks.SetItemRef(link, text, button) end -- 1.7.9.5