console ignore npc messages option

This commit is contained in:
Henrique Santiago 2012-06-11 05:17:52 -03:00
parent e7334566a2
commit c28aff1aa6
1 changed files with 6 additions and 0 deletions

View File

@ -55,6 +55,7 @@ local channelsWindow
local ownPrivateName local ownPrivateName
local messageHistory = {} local messageHistory = {}
local currentMessageIndex = 0 local currentMessageIndex = 0
local ignoreNpcMessages = false
-- private functions -- private functions
local function navigateMessageHistory(step) local function navigateMessageHistory(step)
@ -83,6 +84,7 @@ end
-- hooked events -- hooked events
local function onCreatureSpeak(name, level, speaktype, message, channelId, creaturePos) local function onCreatureSpeak(name, level, speaktype, message, channelId, creaturePos)
if ignoreNpcMessages and speaktype == SpeakPrivateNpcToPlayer then return end
local defaultMessage = speaktype < 3 and true or false local defaultMessage = speaktype < 3 and true or false
speaktype = SpeakTypes[speaktype] speaktype = SpeakTypes[speaktype]
if speaktype.hideInConsole then return end if speaktype.hideInConsole then return end
@ -523,3 +525,7 @@ function Console.getOwnPrivateTab()
if not ownPrivateName then return end if not ownPrivateName then return end
return Console.getTab(ownPrivateName) return Console.getTab(ownPrivateName)
end end
function Console.ignoreNpcMessages(ignore)
ignoreNpcMessages = state
end