-
Notifications
You must be signed in to change notification settings - Fork 1
/
Chat.lua
45 lines (36 loc) · 1.17 KB
/
Chat.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
local addonName, ATOM = ...
local Module = ATOM:NewModule('Chat')
function Module:OnEnable()
self:RegisterEvent('CHAT_MSG_SYSTEM')
self:RegisterChatCommand('clear', 'Clear')
end
function ATOM:Print(...)
DEFAULT_CHAT_FRAME:AddMessage('|cffffff00ATOM:|r ' .. string.format(...))
end
function ATOM:Dump(...)
UIParentLoadAddOn('Blizzard_DebugTools')
if _G['DevTools_Dump'] then
_G['DevTools_Dump'](...)
else
print(...)
end
end
function ATOM:RaidWarning(msg, color)
RaidBossEmoteFrame.slot1:Hide()
RaidNotice_AddMessage(RaidBossEmoteFrame, msg, color or ChatTypeInfo['RAID_BOSS_EMOTE'])
end
function ATOM:MakeChatProgressBar(step, steps)
local barWidth = 40
local barsForCompletedSteps = floor(step / steps * barWidth)
return ('|cffffff00[|cff00ff00%s|r|cff666666%s|r]|r'):format(strrep('||', barsForCompletedSteps),
strrep('||', barWidth - barsForCompletedSteps))
end
function Module:Clear()
DEFAULT_CHAT_FRAME:Clear()
end
function Module:CHAT_MSG_SYSTEM(event, msg)
if string.find(msg, 'You have been outbid on') then
ATOM:RaidWarning(msg)
PlaySound(5958) -- // Time is money, friend.
end
end