diff --git a/.luacov b/.luacov index 8c59a9b..de65935 100644 --- a/.luacov +++ b/.luacov @@ -5,5 +5,8 @@ include = { "^BlizzOverrides/", -- Include all files in BlizzOverrides/ "^config/", -- Include all files in config/ "^Features/", -- Include all files in Features/ + "^GameTesting/", -- Include all files in GameTesting/ + "^LootDisplay/", -- Include all files in LootDisplay/ + "^utils/", -- Include all files in utils/ "^[^/]+$" -- Include all Lua files in the repo root } diff --git a/.pkgmeta b/.pkgmeta index 08a8cb0..2e5aa62 100644 --- a/.pkgmeta +++ b/.pkgmeta @@ -2,6 +2,7 @@ externals: Libs/LibStub: https://repos.wowace.com/wow/ace3/trunk/LibStub Libs/CallbackHandler-1.0: https://repos.wowace.com/wow/ace3/trunk/CallbackHandler-1.0 Libs/AceAddon-3.0: https://repos.wowace.com/wow/ace3/trunk/AceAddon-3.0 + Libs/AceBucket-3.0: https://repos.wowace.com/wow/ace3/trunk/AceBucket-3.0 Libs/AceEvent-3.0: https://repos.wowace.com/wow/ace3/trunk/AceEvent-3.0 Libs/AceDB-3.0: https://repos.wowace.com/wow/ace3/trunk/AceDB-3.0 Libs/AceConsole-3.0: https://repos.wowace.com/wow/ace3/trunk/AceConsole-3.0 @@ -19,8 +20,8 @@ ignore: - spec/* - Makefile - trunk - - *.ps1 - - *.md - - *.rockspec + - "*.ps1" + - "*.md" + - "*.rockspec" - requirements.txt diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..24ee5b1 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/.scripts/hardcode_string_check.py b/.scripts/hardcode_string_check.py index 623f114..642d867 100644 --- a/.scripts/hardcode_string_check.py +++ b/.scripts/hardcode_string_check.py @@ -68,6 +68,7 @@ def scan_directory(directory, ignore_files=None, ignore_dirs=None): def main(): ignore_files = [ + "IntegrationTest.lua", "SmokeTest.lua", ] ignore_dirs = [ diff --git a/BlizzOverrides/BossBanner.lua b/BlizzOverrides/BossBanner.lua index 2c52634..8288532 100644 --- a/BlizzOverrides/BossBanner.lua +++ b/BlizzOverrides/BossBanner.lua @@ -1,28 +1,25 @@ local addonName, G_RLF = ... -local RLF = G_RLF.RLF +local BossBannerOverride = G_RLF.RLF:NewModule("BossBanner", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0") -local bossBannerAttempts = 0 +function BossBannerOverride:OnInitialize() + self:RegisterEvent("PLAYER_ENTERING_WORLD", "BossBannerHook") +end -function RLF:BossBannerHook() +local bossBannerAttempts = 0 +function BossBannerOverride:BossBannerHook() if self:IsHooked(BossBanner, "OnEvent") then return end if BossBanner then self:RawHookScript(BossBanner, "OnEvent", "InterceptBossBannerAlert", true) + self:UnregisterEvent("PLAYER_ENTERING_WORLD") else - if bossBannerAttempts <= 30 then - bossBannerAttempts = bossBannerAttempts + 1 - -- Keep checking until it's available - self:ScheduleTimer("BossBannerHook", 1) - else - self:Print(G_RLF.L["BossBannerAlertUnavailable"]) - self:Print(G_RLF.L["Issues"]) - end + bossBannerAttempts = G_RLF.retryHook(self, "BossBannerHook", bossBannerAttempts, "BossBannerAlertUnavailable") end end -function RLF:InterceptBossBannerAlert(s, event, ...) +function BossBannerOverride:InterceptBossBannerAlert(s, event, ...) if G_RLF.db.global.bossBannerConfig == G_RLF.DisableBossBanner.FULLY_DISABLE then return end @@ -55,3 +52,5 @@ function RLF:InterceptBossBannerAlert(s, event, ...) -- Call the original AddAlert function if not blocked self.hooks[BossBanner].OnEvent(s, event, ...) end + +return BossBannerOverride diff --git a/BlizzOverrides/LootToasts.lua b/BlizzOverrides/LootToasts.lua index 478e52f..4c9f635 100644 --- a/BlizzOverrides/LootToasts.lua +++ b/BlizzOverrides/LootToasts.lua @@ -1,30 +1,30 @@ local addonName, G_RLF = ... -local RLF = G_RLF.RLF +local LootToastOverride = G_RLF.RLF:NewModule("LootToasts", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0") + +function LootToastOverride:OnInitialize() + self:RegisterEvent("PLAYER_ENTERING_WORLD", "LootToastHook") +end local lootAlertAttempts = 0 -function RLF:LootToastHook() - if RLF:IsHooked(LootAlertSystem, "AddAlert") then +function LootToastOverride:LootToastHook() + if self:IsHooked(LootAlertSystem, "AddAlert") then return end if LootAlertSystem and LootAlertSystem.AddAlert then - RLF:RawHook(LootAlertSystem, "AddAlert", "InterceptAddAlert", true) + self:RawHook(LootAlertSystem, "AddAlert", "InterceptAddAlert", true) + self:UnregisterEvent("PLAYER_ENTERING_WORLD") else - if lootAlertAttempts <= 30 then - lootAlertAttempts = lootAlertAttempts + 1 - -- Keep checking until it's available - RLF:ScheduleTimer("LootToastHook", 1) - else - RLF:Print(G_RLF.L["AddLootAlertUnavailable"]) - RLF:Print(G_RLF.L["Issues"]) - end + lootAlertAttempts = G_RLF.retryHook(self, "LootToastHook", lootAlertAttempts, "AddLootAlertUnavailable") end end -function RLF:InterceptAddAlert(frame, ...) +function LootToastOverride:InterceptAddAlert(frame, ...) if G_RLF.db.global.disableBlizzLootToasts then return end -- Call the original AddAlert function if not blocked - RLF.hooks[LootAlertSystem].AddAlert(frame, ...) + self.hooks[LootAlertSystem].AddAlert(frame, ...) end + +return LootToastOverride diff --git a/BlizzOverrides/MoneyAlerts.lua b/BlizzOverrides/MoneyAlerts.lua index 03b5d49..29fa4b5 100644 --- a/BlizzOverrides/MoneyAlerts.lua +++ b/BlizzOverrides/MoneyAlerts.lua @@ -1,30 +1,30 @@ local addonName, G_RLF = ... -local RLF = G_RLF.RLF +local MoneyAlertOverride = G_RLF.RLF:NewModule("MoneyAlerts", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0") + +function MoneyAlertOverride:OnInitialize() + self:RegisterEvent("PLAYER_ENTERING_WORLD", "MoneyAlertHook") +end local moneyAlertAttempts = 0 -function RLF:MoneyAlertHook() - if RLF:IsHooked(MoneyWonAlertSystem, "AddAlert") then +function MoneyAlertOverride:MoneyAlertHook() + if self:IsHooked(MoneyWonAlertSystem, "AddAlert") then return end if MoneyWonAlertSystem and MoneyWonAlertSystem.AddAlert then - RLF:RawHook(MoneyWonAlertSystem, "AddAlert", "InterceptMoneyAddAlert", true) + self:RawHook(MoneyWonAlertSystem, "AddAlert", "InterceptMoneyAddAlert", true) + self:UnregisterEvent("PLAYER_ENTERING_WORLD") else - if moneyAlertAttempts <= 30 then - moneyAlertAttempts = moneyAlertAttempts + 1 - -- Keep checking until it's available - RLF:ScheduleTimer("MoneyAlertHook", 1) - else - RLF:Print(G_RLF.L["AddMoneyAlertUnavailable"]) - RLF:Print(G_RLF.L["Issues"]) - end + moneyAlertAttempts = G_RLF.retryHook(self, "MoneyAlertHook", moneyAlertAttempts, "AddMoneyAlertUnavailable") end end -function RLF:InterceptMoneyAddAlert(frame, ...) +function MoneyAlertOverride:InterceptMoneyAddAlert(frame, ...) if G_RLF.db.global.disableBlizzMoneyAlerts then return end -- Call the original AddAlert function if not blocked - RLF.hooks[MoneyWonAlertSystem].AddAlert(frame, ...) + self.hooks[MoneyWonAlertSystem].AddAlert(frame, ...) end + +return MoneyAlertOverride diff --git a/BlizzOverrides/overrides.xml b/BlizzOverrides/overrides.xml index 6ba0096..36804bd 100644 --- a/BlizzOverrides/overrides.xml +++ b/BlizzOverrides/overrides.xml @@ -2,6 +2,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd"> +