Quantcast
WoWInterface - View Single Post - Using GetBindingKey() on MultiActionBars
View Single Post
06-19-19, 12:33 PM   #3
DashingSplash
A Murloc Raider
Join Date: Jun 2019
Posts: 7
Originally Posted by MunkDev View Post
Not sure why you assumed that the button names would correspond to the binding names,
but e.g. MultiBarBottomLeftButton1 is actually MULTIACTIONBAR1BUTTON1 in the binding manifest.
ActionButton1 just happens to correspond to ACTIONBUTTON1, but they are not the same.
I made that assumption since the examples that I have seen uses them. However, I have tried and GetBindingKey() seems to be case sensitive: ActionButton1 works, while ACTIONBUTTON1 and any other variation does not.

After an hour of tinkering and trial-and-error I simply can't get MULTIACTIONBAR1BUTTON1 or MultiActionBar1Button1 to work.

With the following code I also only managed to get it to work with ActionButton1:

Code:
local function dashingBindings(low, high)
	for i=low,high do
		local Button
		local actionType, id, _
		local actionName
		local command, _, key1, key2 = GetBinding(i)
		
		if not command:find("HEADER_BLANK") then
			print(command)
		
			Button = string.gsub(_G["BINDING_NAME_" .. command], " ", "")
			
			print(Button)
			if _G[Button] ~= nil then
				actionType, id, _ = GetActionInfo(ActionButton_CalculateAction(_G[Button]))
				actionName = GetSpellInfo(id)
		
				if key1 ~= nil then
					print(key1)
				end
				if key2 ~= nil then
					print(key2)
				end
			end	
		end	
	end
end

local function dashingInit(self, event, ...)
	dashingBindings(31,42)
	dashingBindings(74,121)
end
The problem here is that Button = string.gsub(_G["BINDING_NAME_" .. command], " ", "") will produce the string BottomLeftActionButton1 while the variable "command" will contain the string MULTIACTIONBAR1BUTTON1. Not been able to utilize "command" with the GetBindingKey() function.

I seemingly can't get it to work at all, so if you have any suggestions where to go from here that would be great. If anyone else has any ideas, feel free to post them.
  Reply With Quote