-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathToastBlocker.lua
More file actions
41 lines (36 loc) · 1.1 KB
/
Copy pathToastBlocker.lua
File metadata and controls
41 lines (36 loc) · 1.1 KB
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
-- ToastBlocker: Blocks all toasts in WoW 3.3.5
local frame = CreateFrame("Frame")
local enabled = true
-- Function to hide/show the toast container
local function UpdateToastVisibility()
if ToastContainer then
if enabled then
ToastContainer:Hide()
else
ToastContainer:Show()
end
end
end
-- Register for events
frame:RegisterEvent("ADDON_LOADED")
frame:RegisterEvent("PLAYER_LOGIN")
frame:SetScript("OnEvent", function(self, event, arg1)
if event == "ADDON_LOADED" and arg1 == "ToastBlocker" then
print("|cff00ff00ToastBlocker loaded:|r Use /toastblock to toggle")
UpdateToastVisibility()
elseif event == "PLAYER_LOGIN" then
UpdateToastVisibility()
end
end)
-- Toggle command
SLASH_TOASTBLOCK1 = "/toastblock"
SLASH_TOASTBLOCK2 = "/tb"
SlashCmdList["TOASTBLOCK"] = function()
enabled = not enabled
UpdateToastVisibility()
if enabled then
print("|cff00ff00ToastBlocker:|r Toasts are now |cffff0000BLOCKED|r")
else
print("|cff00ff00ToastBlocker:|r Toasts are now |cff00ff00ENABLED|r")
end
end