Thread Tools Display Modes
04/13/14, 08:19 PM   #1
Etupa
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 8
My first addon, mute NPC !

Hi, I spend many hours trying to figure out why keybindings doesn't work... they're available in setup but they doesn't work at all.

If anyone can help with this?

/mu and /un commands work well though... Still have to understand how to switch between 1 or 100 with the same command/keybind too. (I'm a true noob at this)


For bindings.xml
Code:
<Bindings>
  <Layer name="Addons">
    <Category name="Mute NPC">
      <Action name="MUTENPC">
		  <Down>mute()</Down>
	</Action>
		  <Action name="UNMUTENPC">
		<Down>unmu()</Down>
      </Action>
    </Category>
  </Layer>
</Bindings>
For Lua
Code:
MuteNPC = {}

local function Initialize( self, addOnName )
  if addOnName ~= "MuteNPC" then return end
end

ZO_CreateStringId("SI_BINDING_NAME_MUTENPC", "Mute Npc")
ZO_CreateStringId("SI_BINDING_NAME_UNMUTENPC", "Unmute Npc")

function mute()	
	local control = ZO_OptionsWindow.controlTable[2][9]
	SetSetting(control.system, control.settingId, 1)	
end


function unmu()	
	local control = ZO_OptionsWindow.controlTable[2][9]
	SetSetting(control.system, control.settingId, 100)	
end

SLASH_COMMANDS["/mu"] = mute
SLASH_COMMANDS["/un"] = unmu

EVENT_MANAGER:RegisterForEvent("MuteNPC", EVENT_ADD_ON_LOADED, Initialize )
txt
Code:
## Title: Mute NPC
## APIVersion: 100003
## Title: Etupa First


MuteNPC.lua
Bindings.xml
 
04/14/14, 04:04 AM   #2
Etupa
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 8
Ok done, thanks to Halja !

My problem was mainly my french client.


Code:
<Bindings>
  <Layer name="SI_KEYBINDINGS_LAYER_GENERAL">
    <Category name="SI_KEYBINDINGS_CATEGORY_USER_INTERFACE">
		<Action name="MUTENPC">
		  <Down>mute()</Down>
		</Action>
		<Action name="UNMUTENPC">
			<Down>unmu()</Down>
		</Action>
    </Category>
  </Layer>
</Bindings>
Great, I share this now xD
 

ESOUI » AddOns » Alpha/Beta AddOns » My first addon, mute NPC !

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