From ff0be0aefdf744e343e89cea6f2bf3b274324a8e Mon Sep 17 00:00:00 2001 From: andrew6180 <16847730+andrew6180@users.noreply.github.com> Date: Mon, 3 Jul 2023 18:42:58 -0700 Subject: [PATCH] Modules/Auras: make auras linkable in chat --- ElvUI/Core/Core.lua | 4 ++-- ElvUI/Modules/ActionBars/ActionBars.lua | 4 +--- ElvUI/Modules/Auras/Auras.lua | 16 ++++++++++++++-- ElvUI/Settings/Profile.lua | 5 ++--- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ElvUI/Core/Core.lua b/ElvUI/Core/Core.lua index 8e17924..bc6a2d9 100644 --- a/ElvUI/Core/Core.lua +++ b/ElvUI/Core/Core.lua @@ -54,7 +54,7 @@ E.noop = function() end E.title = format("|cff1784d1E|r|cffe5e3e3lvUI|r") E.myfaction, E.myLocalizedFaction = UnitFactionGroup("player") E.mylevel = UnitLevel("player") -E.myLocalizedClass, E.myclass = UnitClass("player") +E.myLocalizedClass, E.myclass = UnitClass("player") -- On Ascension, this is always (Hero, HERO) E.myLocalizedRace, E.myrace = UnitRace("player") E.myname = UnitName("player") E.myrealm = GetRealmName() @@ -1243,4 +1243,4 @@ function E:Initialize() if GetCVar("scriptProfile") ~= "1" then collectgarbage("collect") end -end +end \ No newline at end of file diff --git a/ElvUI/Modules/ActionBars/ActionBars.lua b/ElvUI/Modules/ActionBars/ActionBars.lua index 2ce2ba9..8e05dcf 100644 --- a/ElvUI/Modules/ActionBars/ActionBars.lua +++ b/ElvUI/Modules/ActionBars/ActionBars.lua @@ -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") diff --git a/ElvUI/Modules/Auras/Auras.lua b/ElvUI/Modules/Auras/Auras.lua index e30d812..82afbc5 100644 --- a/ElvUI/Modules/Auras/Auras.lua +++ b/ElvUI/Modules/Auras/Auras.lua @@ -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() diff --git a/ElvUI/Settings/Profile.lua b/ElvUI/Settings/Profile.lua index 8b1986a..db1780b 100644 --- a/ElvUI/Settings/Profile.lua +++ b/ElvUI/Settings/Profile.lua @@ -4018,11 +4018,10 @@ P.actionbar = { showGrid = true, paging = { HERO = "[bonusbar:1,nostealth] 7; [bonusbar:1,stealth] 8; [bonusbar:2] 8; [bonusbar:3] 9; [bonusbar:4] 10;", - PROPHET = "[stealth] 7; [nostealth] 1;", RANGER = "[stealth] 7; [nostealth] 1;", REAPER = "[stealth] 7; [nostealth] 1;", - ROGUE = "[stealth] 7; [nostealth] 1;", SPIRITMAGE = "[stealth] 7; [nostealth] 1;", + PROPHET = "[stealth] 7; [nostealth] 1;", }, visibility = "" }, @@ -4201,4 +4200,4 @@ do -- cooldown stuff -- we gonna need this on by default :3 P.cooldown.enable = true -end +end \ No newline at end of file