View Single Post
03-10-24, 03:48 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,937
This is code I got from the official action button file and incorporated into my own button.

Lua Code:
  1. -- Get the binding key ( if any ) for this button and display it
  2.     local key = GetBindingKey("CLICK "..DFMB:GetName()..":LeftButton")
  3.     local text = GetBindingText(key, 1)
  4.     if ( text == "" ) then
  5.         DFMB.HotKey:Hide()
  6.     else
  7.         DFMB.HotKey:SetText(text)
  8.         DFMB.HotKey:Show()
  9.     end

This is the part of the official code I based it on.
https://github.com/Gethe/wow-ui-sour...utton.lua#L453

Hopefully it will help see where you might be going wrong. Because my button isn't based on a Blizzard template ( it doesn't have to be a secure frame ) I had to set up the related Binding information such as a localized global string and a Bindings.xml file set up with the binding key chosen by the player.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote