View Single Post
03-27-13, 08:35 AM   #1
fRodzet
A Flamescale Wyrmkin
Join Date: Mar 2013
Posts: 114
Help with ModifiedClick bindings

Greetings,

Lua Code:
  1. -- create a table which contains the index you'd like to show in your tooltip
  2. local supportedIndexType = {
  3.     item = true,
  4.     achievement = true,
  5.     quest = true,
  6.     unit = true,
  7.     enchant = true,
  8.     spell = true,
  9.     talent = true,
  10.     glyph = true,
  11.     }
  12. -- create a function which contains the scripts necessary to display the tooltip we need
  13. local function ChatlinkTooltip_Show(self, linkData)
  14.     local linkType = string.match(linkData, "(.-):")
  15.         if supportedIndexType[linkType] then
  16.             GameTooltip:SetOwner(self, "ANCHOR_CURSOR")
  17.             GameTooltip:SetHyperlink(linkData)
  18.             GameTooltip:Show()
  19.         end
  20. end
  21.  
  22. for frameType = 1, NUM_CHAT_WINDOWS do
  23.     local chatType = _G["ChatFrame" .. frameType]
  24.         chatType:HookScript("OnHyperLinkEnter", ChatlinkTooltip_Show)
  25.         chatType:HookScript("OnHyperLinkLeave", GameTooltip_Hide)  
  26. end

This is my lua code so far, i then added a ModifiedClick binding to the bindings.xml:

Lua Code:
  1. <Bindings>
  2.     <ModifiedClick action="COMPAREITEMS" default="SHIFT"/>
  3. </Bindings>

But it doesn't work the proper way, i know that i miss something in my lua code to make it show properly.

If i hold down shift before i enter the link in the chat, the tooltip for both the one in chat and the one i have equipped shows.. However, if i'm at my link and i click shift, nothing happends. How can i make this possible, thanks?
  Reply With Quote