Verified Commit 40fb0c71 authored by Repooc's avatar Repooc
Browse files

Some clean up and get away from self references to be more clear for people like me

parent af94edeb
local SLE, T, E, L, V, P, G = unpack(select(2, ...))
local DB = SLE:NewModule("DataBars","AceHook-3.0", "AceEvent-3.0")
local DB = SLE:NewModule('DataBars', 'AceHook-3.0', 'AceEvent-3.0')
--GLOBALS: ChatFrame_AddMessageEventFilter, ChatFrame_RemoveMessageEventFilter
DB.Icons = {
Rep = [[Interface\Icons\Achievement_Reputation_08]],
......@@ -8,19 +9,19 @@ DB.Icons = {
function DB:RegisterFilters()
if E.db.sle.databars.rep.chatfilter.enable then
ChatFrame_AddMessageEventFilter("CHAT_MSG_COMBAT_FACTION_CHANGE", self.FilterReputation)
ChatFrame_AddMessageEventFilter('CHAT_MSG_COMBAT_FACTION_CHANGE', DB.FilterReputation)
else
ChatFrame_RemoveMessageEventFilter("CHAT_MSG_COMBAT_FACTION_CHANGE", self.FilterReputation)
ChatFrame_RemoveMessageEventFilter('CHAT_MSG_COMBAT_FACTION_CHANGE', DB.FilterReputation)
end
if E.db.sle.databars.exp.chatfilter.enable then
ChatFrame_AddMessageEventFilter("CHAT_MSG_COMBAT_XP_GAIN", self.FilterExperience)
ChatFrame_AddMessageEventFilter('CHAT_MSG_COMBAT_XP_GAIN', DB.FilterExperience)
else
ChatFrame_RemoveMessageEventFilter("CHAT_MSG_COMBAT_XP_GAIN", self.FilterExperience)
ChatFrame_RemoveMessageEventFilter('CHAT_MSG_COMBAT_XP_GAIN', DB.FilterExperience)
end
if E.db.sle.databars.honor.chatfilter.enable then
ChatFrame_AddMessageEventFilter("CHAT_MSG_COMBAT_HONOR_GAIN", self.FilterHonor)
ChatFrame_AddMessageEventFilter('CHAT_MSG_COMBAT_HONOR_GAIN', DB.FilterHonor)
else
ChatFrame_RemoveMessageEventFilter("CHAT_MSG_COMBAT_HONOR_GAIN", self.FilterHonor)
ChatFrame_RemoveMessageEventFilter('CHAT_MSG_COMBAT_HONOR_GAIN', DB.FilterHonor)
end
end
......@@ -32,6 +33,7 @@ function DB:Initialize()
function DB:ForUpdateAll()
DB:RegisterFilters()
end
DB:ExpInit()
DB:RepInit()
......@@ -39,10 +41,9 @@ function DB:Initialize()
DB:HonorInit()
DB:ForUpdateAll()
-- self:RegisterEvent("CHAT_MSG_COMBAT_FACTION_CHANGE", "NewRepString")
self:RegisterEvent("UPDATE_FACTION", "NewRepString")
-- self:RegisterEvent('CHAT_MSG_COMBAT_FACTION_CHANGE', 'NewRepString')
DB:RegisterEvent('UPDATE_FACTION', 'NewRepString')
DB:NewRepString()
end
SLE:RegisterModule(DB:GetName())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment