Thread Tools Display Modes
04/13/14, 03:31 PM   #1
Etupa
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 8
[Request] Mute/unmute NPC shortcut

The name says it all !

A slash command or better, a keybind. :3

What I can tell to devs from zgoo output.


A__Zgoo_ToggleHidden() = function
(m) ClearAnchors() = function
["controlType"] = 4
(m) CreateControl() = function
["currentChoice"] = 45 <--------------------------- Current volume, value from 0 to 100.
["eventCallbacks"] = table [#0,2]
(m) GetAlpha() = 1
(m) GetAnchor() = table [#6,6]
(m) GetBottom() = 468.72219848633
(m) GetCenter() = table [#2,2]
(m) GetChild() = BLACKLISTED
GetChildren() = table [#3,3]
(m) GetClampedToScreen() = false
(m) GetClampedToScreenInsets() = table [#4,4]
(m) GetDesiredHeight() = 26
(m) GetDesiredWidth() = 490
(m) GetDimensionConstraints() = table [#4,4]
(m) GetDimensions() = table [#2,2]
(m) GetDrawLayer() = 1
(m) GetDrawLevel() = 0
(m) GetDrawTier() = 0
(m) GetExcludeFromResizeToFitExtents() = false
(m) GetHandler() = BLACKLISTED
(m) GetHeight() = 26
(m) GetHitInsets() = table [#4,4]
(m) GetId() = 0
(m) GetInheritsAlpha() = true
(m) GetInheritsScale() = true
(m) GetLeft() = 330
(m) GetName() = "Options_Audio_VOVolume" <---------------chan to mute/unmute
(m) GetNamedChild() = BLACKLISTED
(m) GetNumChildren() = 3



I've read about creating slash command, and keybind but really don't have a clue where to begin ;___;
  Reply With Quote
04/13/14, 06:25 PM   #2
Etupa
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 8
So far it works... dunno how, looking for Keybind/macro now, it's hard to make it works ^^,

Highly inspired from Borrower and Lender add on


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 )

Last edited by Etupa : 04/13/14 at 08:02 PM.
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » [Request] Mute/unmute NPC shortcut


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