View Single Post
03-10-24, 05:28 AM   #3
wmcarlos
A Defias Bandit
Join Date: Mar 2024
Posts: 2
Originally Posted by Xrystal View Post
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.
Oh yeah, thanks a lot!
  Reply With Quote