Thread Tools Display Modes
03/02/17, 12:33 AM   #1
static_recharge
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 35
Keybind Strip - Not Sure What I'm Missing

So I've been at this for a few hours now and can't for the life of me find where I am messing up. I am new to the keybind strip, but I have followed the tutorial on the wiki as well as looked to other add-ons for proper implementations. The issue is that my keybind shows up on the keybind strip, with the proper name and everything, but it does absolutely nothing when I press the assigned button. I can't even get it to print back a test message in the chat window. I will post the related code here, if you need more info let me know and thanks in advance for taking a look!

main LUA file:
Code:
MI.KeybindStrip = {
	{
		alignment = KEYBIND_STRIP_ALIGN_LEFT,
		name = "Add to Group",
		keybind = "MI_ADD_TO_GROUP",
		callback = function() d("test") end,
	},
}

function MI.EditorChange(eventCode, oldMode, newMode)
	if newMode == ZOS.HOUSING_EDITOR_MODE_PLACEMENT then
		KEYBIND_STRIP:AddKeybindButtonGroup(MI.KeybindStrip)
	else
		KEYBIND_STRIP:RemoveKeybindButtonGroup(MI.KeybindStrip)
	end
end

function MI.Setup()
	ZO_CreateStringId("SI_BINDING_NAME_MI_ADD_TO_GROUP", "Add to Group")
	
	EVENT_MANAGER:RegisterForEvent(MI.addonName, EVENT_HOUSING_EDITOR_MODE_CHANGED, MI.EditorChange)
	
	EVENT_MANAGER:UnregisterForEvent(MI.addonName, EVENT_ADD_ON_LOADED)
end

function MI_ADD_TO_GROUP()
	d("test")
end
bindings.xml
Code:
<Bindings>
	<Layer name="SI_KEYBINDINGS_LAYER_USER_INTERFACE_SHORTCUTS">
		<Category name="Move It">
			<Action name="MI_ADD_TO_GROUP">
				<Down> MI_ADD_TO_GROUP() </Down>
			</Action>
		</Category>
	</Layer>
</Bindings>
  Reply With Quote
03/02/17, 12:45 AM   #2
static_recharge
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 35
Actually I just realised my issue and fixed it.

I had to change:
Code:
<Layer name="SI_KEYBINDINGS_LAYER_USER_INTERFACE_SHORTCUTS">
to:
Code:
<Layer name="SI_KEYBINDINGS_LAYER_HOUSING_EDITOR">
because I am in the housing editor ui. Hope this helps anyone with the same issue!
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Keybind Strip - Not Sure What I'm Missing

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off