Added in message for keybinding to indicate mute status

Wobin [05-18-14 - 16:04]
Added in message for keybinding to indicate mute status
Now should work for chatter options other than the first being 'Bank' (eg, Coldharbour)
Filename
BorrowerAndLender.lua
diff --git a/BorrowerAndLender.lua b/BorrowerAndLender.lua
index 7c537b2..029cf4c 100644
--- a/BorrowerAndLender.lua
+++ b/BorrowerAndLender.lua
@@ -7,7 +7,7 @@ local inBank
 local control = ZO_OptionsWindow.controlTable[2][9]
 local currentWait = nil
 local settings
-
+local chatOptions = {ZO_ChatterOption1, ZO_ChatterOption2, ZO_ChatterOption3} -- Just covering our bases

 local function EndsWith(String,End)
    return End=='' or string.sub(String,-string.len(End))==End
@@ -23,11 +23,15 @@ local function SpeakUpLad()
 	SetSetting(control.system, control.settingId, settings.defaultSoundLevel)
 end

+
+
 local function WhoAmI(eventCode, options)
-	if EndsWith(ZO_ChatterOption1:GetText(), GetString(SI_INTERACT_OPTION_BANK)) then
-		if currentWait then BorrowerAndLender:CancelTimer(currentWait) end
-		currentWait = BorrowerAndLender:ScheduleTimer(SpeakUpLad, (#ZO_InteractWindowTargetAreaBodyText:GetText()/15) + 5)
-		Hush()
+	for i,v in ipairs(chatOptions) do
+		if v and EndsWith(v:GetText(), GetString(SI_INTERACT_OPTION_BANK)) then
+			if currentWait then BorrowerAndLender:CancelTimer(currentWait) end
+			currentWait = BorrowerAndLender:ScheduleTimer(SpeakUpLad, (#ZO_InteractWindowTargetAreaBodyText:GetText()/15) + 5)
+			return Hush()
+		end
 	end
 end

@@ -147,8 +151,10 @@ function BorrowerAndLender:CommandHandler()
 	settings.muteAmbient = not settings.muteAmbient
 	if settings.muteAmbient == false then
 		EVENT_MANAGER:UnregisterForEvent("BALChat", EVENT_CHAT_MESSAGE_CHANNEL)
+		ZO_Alert(UI_ALERT_CATEGORY_ALERT, 1, "Unmuting Ambient NPCs")
 	else
 		EVENT_MANAGER:RegisterForEvent("BALChat", EVENT_CHAT_MESSAGE_CHANNEL, FilterNPC)
+		ZO_Alert(UI_ALERT_CATEGORY_ALERT, 1, "Muting Ambient NPCs")
 	end

 end