WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Artifact Trait Linking (https://www.wowinterface.com/forums/showthread.php?t=54389)

Rotnob 09-04-16 06:08 PM

Artifact Trait Linking
 
Looking for an addon which can create chat links for the proper spells when shift-clicking artifact traits. Thanks!

Ketho 09-04-16 10:46 PM

Don't know if there are any other addons already doing this, but something like this could work

I'm not sure if prehooking instead of posthooking would taint the Artifact UI, but it prevents accidentally buying traits if you wanted to shift-click instead
(drycoded/untested since I'm still waiting for my Legion package and don't have any AP on the beta)

There is C_ArtifactUI.GetPowerInfo() but we can already grab the Spell ID I suppose

https://github.com/Gethe/wow-ui-sour...on.lua#L37-L58
https://github.com/Gethe/wow-ui-sour....lua#L368-L386

ArtifactTraitLink.lua
Lua Code:
  1. local oldOnClick = ArtifactPowerButtonMixin.OnClick
  2.  
  3. -- rather prehook than posthook to prevent purchasing traits
  4. function ArtifactPowerButtonMixin:OnClick(button)
  5.     if IsModifiedClick("CHATLINK") then
  6.         ChatEdit_InsertLink(GetSpellLink(self.spellID))
  7.     else
  8.         oldOnClick(self, button)
  9.     end
  10. end

ArtifactTraitLink.toc
Code:

## Interface: 70000
## Version: v1.0.3
## Title: ArtifactTraitLink
## Notes: Lets you Shift-Click artifact traits to chat
## LoadOnDemand: 1
## LoadWith: Blizzard_ArtifactUI

ArtifactTraitLink.lua

http://www.wowinterface.com/download...TraitLink.html

Rotnob 09-05-16 11:50 AM

Works great, thanks!!


All times are GMT -6. The time now is 08:17 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI