Modules/Auras: make auras linkable in chat

This commit is contained in:
andrew6180
2023-07-03 18:42:58 -07:00
parent 3ced5b716b
commit e54c3efbd0
4 changed files with 18 additions and 8 deletions
+1 -3
View File
@@ -376,9 +376,7 @@ function AB:CreateVehicleLeave()
vehicle:SetScript("OnClick", Vehicle_ExitVehicle)
vehicle:SetScript("OnEvent", Vehicle_OnEvent)
if MainMenuBarVehicleLeaveButtonMixin then
vehicle:SetScript("OnEnter", MainMenuBarVehicleLeaveButtonMixin.OnEnter)
end
vehicle:SetScript("OnEnter", MainMenuBarVehicleLeaveButtonMixin.OnEnter)
vehicle:SetScript("OnLeave", GameTooltip_Hide)
vehicle:RegisterEvent("PLAYER_ENTERING_WORLD")
vehicle:RegisterEvent("UPDATE_BONUS_ACTIONBAR")
+14 -2
View File
@@ -121,7 +121,19 @@ local OnLeave = function()
GameTooltip:Hide()
end
local OnClick = function(self)
local OnClick = function(self, button)
if button == "LeftButton" then
if IsModifiedClick("CHATLINK") then
local spellID = select(11, UnitAura("player", self:GetID(), self:GetParent().filter))
if spellID then
local link = LinkUtil:GetSpellLink(spellID)
if link then
ChatEdit_InsertLink(link)
end
end
end
return
end
if self.IsWeapon then
CancelItemTempEnchantment(self:GetID())
else
@@ -140,7 +152,7 @@ function A:CreateIcon(button)
button.auraType = "buffs"
end
button:RegisterForClicks("RightButtonUp")
button:RegisterForClicks("LeftButtonUp", "RightButtonUp")
button.texture = button:CreateTexture(nil, "BORDER")
button.texture:SetInside()