ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Search/Requests (https://www.esoui.com/forums/forumdisplay.php?f=165)
-   -   [Request] Mute/unmute NPC shortcut (https://www.esoui.com/forums/showthread.php?t=851)

Etupa 04/13/14 03:31 PM

[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 ;___;

Etupa 04/13/14 06:25 PM

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 :D


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 )



All times are GMT -6. The time now is 09:51 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI