# HG changeset patch # User Xiiph # Date 1297374371 -3600 # Node ID 8ec216b40ded251cf580958e583b5cba2667efa1 # Parent 43155c3c1700a06bc6e0cf0d2f3dbf7b646bf793 Added report of no missing buffs. Fixed chat filtering. diff -r 43155c3c1700 -r 8ec216b40ded ICU.lua --- a/ICU.lua Sun Feb 06 14:07:20 2011 +0100 +++ b/ICU.lua Thu Feb 10 22:46:11 2011 +0100 @@ -3,6 +3,9 @@ local icu = LibStub("AceAddon-3.0"):NewAddon("ICU", "AceEvent-3.0", "AceTimer-3.0"); +-- Move global namespace to local +local _G = _G; + -- UTF8 -- Accepted flasks local flaskID = { @@ -352,7 +355,7 @@ end - if self.db.profile.reportResults and (#noFlask > 0 or #noFood > 0) and self.db.profile.advertiseICU and self.db.profile.reportDestination ~= "SELF" then + if self.db.profile.reportResults and self.db.profile.reportDestination ~= "SELF" then SendChatMessage("---- "..L["ICU"].." "..L["Report"].." ----",self.db.profile.reportDestination,nil,nil); end @@ -365,6 +368,12 @@ else SendChatMessage(reportFlaskMessage,self.db.profile.reportDestination,nil,nil); end + elseif self.db.profile.checkFlask then -- Nobody is missing a flask + if self.db.profile.reportDestination == "SELF" then + DEFAULT_CHAT_FRAME:AddMessage(L["Nobody is missing a proper flask."]); + else + SendChatMessage(L["Nobody is missing a proper flask."],self.db.profile.reportDestination,nil,nil); + end end if #noFood > 0 and self.db.profile.checkFood then @@ -375,7 +384,14 @@ else SendChatMessage(reportFoodMessage,self.db.profile.reportDestination,nil,nil); end + elseif self.db.profile.checkFood then -- Nobody is missing a food buff + if self.db.profile.reportDestination == "SELF" then + DEFAULT_CHAT_FRAME:AddMessage(L["Nobody is missing a proper food buff."]); + else + SendChatMessage(L["Nobody is missing a proper food buff."],self.db.profile.reportDestination,nil,nil); + end end + end noFlask, noFood, hasLowDuration = {},{},{}; @@ -440,9 +456,9 @@ return self.db; end -function filterChat(self, event, msg) +local function filterChat(self, event, msg) local db = icu:getDB(); - if msg == db.profile.noFoodMessage or msg == db.profile.noFlaskMessage or msg == db.profile.lowFlaskDurationMessage or msg == L["ICU"]..": "..db.profile.noFoodMessage or msg == L["ICU"]..": "..db.profile.noFlaskMessage or msg == L["ICU"]..": "..db.profile.lowFlaskDurationMessage then return true end + if msg == db.profile.noFoodMessage or msg == db.profile.noFlaskMessage or msg == db.profile.lowFlaskDurationMessage or msg == (L["ICU"]..": "..db.profile.noFoodMessage) or msg == (L["ICU"]..": "..db.profile.noFlaskMessage) or msg == (L["ICU"]..": "..db.profile.lowFlaskDurationMessage) then return true end end ChatFrame_AddMessageEventFilter("CHAT_MSG_WHISPER_ICU_INFORM", filterChat) diff -r 43155c3c1700 -r 8ec216b40ded enUS.lua --- a/enUS.lua Sun Feb 06 14:07:20 2011 +0100 +++ b/enUS.lua Thu Feb 10 22:46:11 2011 +0100 @@ -7,6 +7,9 @@ L["Well Fed reminder!"] = true L["Flask reminder!"] = true L["Your Flask runs out in less than 10 minutes!"] = true +L["Nobody is missing a proper flask."] = true +L["Nobody is missing a proper food buff."] = true + L["Options"] = true L["Shows the blizzard addon configuration window"] = true