From 0d9e9735daf3d7e68fdfc0461227780c4922766f Mon Sep 17 00:00:00 2001 From: Sumsebrum Date: Thu, 13 Jan 2022 23:11:06 +0100 Subject: [PATCH] add unregister messages to gladdy messages --- Gladdy.lua | 10 ++++++++++ Modules/Announcements.lua | 1 + 2 files changed, 11 insertions(+) diff --git a/Gladdy.lua b/Gladdy.lua index 416ba57..eb14d39 100644 --- a/Gladdy.lua +++ b/Gladdy.lua @@ -191,6 +191,16 @@ function Gladdy:NewModule(name, priority, defaults) self.messages[message] = func or message end + module.UnregisterMessage = function(self, message) + self.messages[message] = nil + end + + module.UnregisterAllMessages = function(self) + for msg,_ in pairs(self.messages) do + self.messages[msg] = nil + end + end + module.GetOptions = function() return nil end diff --git a/Modules/Announcements.lua b/Modules/Announcements.lua index 3c8b376..27de5f1 100644 --- a/Modules/Announcements.lua +++ b/Modules/Announcements.lua @@ -53,6 +53,7 @@ function Announcements:Initialize() end function Announcements:Reset() + self:UnregisterAllMessages() self.enemy = {} self.throttled = {} end