From 04e5fb057fee02f557c4526f116092710259e1f0 Mon Sep 17 00:00:00 2001 From: Rob Anderson Date: Fri, 15 Nov 2024 18:38:18 -0700 Subject: [PATCH] v1.9.0 (#193) * Close #185: Add total item count to item loot rows * Close #186: Show Brann's level and XP progress * Close #188: Profession Skill Ups * Close #161: Highlight notable loot * Close #13: Highlight Better Than Equipped * Close #20: Add TSM and Auctionator integration --- .luacov | 3 + .pkgmeta | 7 +- .python-version | 1 + .scripts/hardcode_string_check.py | 1 + BlizzOverrides/BossBanner.lua | 23 +- BlizzOverrides/LootToasts.lua | 28 +- BlizzOverrides/MoneyAlerts.lua | 28 +- BlizzOverrides/overrides.xml | 1 + BlizzOverrides/retryHook.lua | 16 + Core.lua | 177 ++++----- Features/Currency.lua | 48 ++- Features/Experience.lua | 18 +- Features/ItemLoot.lua | 264 -------------- Features/ItemLoot/AuctionIntegrations.lua | 115 ++++++ Features/ItemLoot/ItemLoot.lua | 338 ++++++++++++++++++ Features/ItemLoot/ItemLoot.xml | 7 + Features/LootDisplayProperties.lua | 13 +- Features/Money.lua | 15 +- Features/Professions.lua | 119 ++++++ Features/Reputation.lua | 177 +++++---- Features/features.xml | 3 +- GameTesting/IntegrationTest.lua | 155 ++++++++ .../Profiling.lua | 0 SmokeTest.lua => GameTesting/SmokeTest.lua | 83 +---- TestMode.lua => GameTesting/TestMode.lua | 150 ++++---- GameTesting/testing.xml | 8 + LootDisplay/LootDisplay.lua | 136 ++++--- .../LootDisplayFrame/LootDisplayFrame.lua | 10 +- .../LootDisplayRow/LootDisplayRow.lua | 129 ++++++- .../LootDisplayRow/LootDisplayRowTemplate.xml | 1 + RPGLootFeed.lua | 95 ----- RPGLootFeed.toc | 19 +- config/{ => Features}/Features.lua | 73 ++-- config/Features/ItemConfig.lua | 299 ++++++++++++++++ config/Features/features.xml | 12 + config/config.xml | 2 +- embeds.xml | 1 + locale/enUS.lua | 20 ++ spec/BlizzOverrides/BossBanner_spec.lua | 109 +++++- spec/BlizzOverrides/LootToasts_spec.lua | 60 +++- spec/BlizzOverrides/MoneyAlerts_spec.lua | 60 ++++ spec/BlizzOverrides/retryHook_spec.lua | 35 ++ spec/Core_spec.lua | 105 +++++- spec/Features/Currency_spec.lua | 16 +- spec/Features/Experience_spec.lua | 6 +- spec/Features/ItemLoot_spec.lua | 100 +++++- spec/Features/LootDisplayProperties_spec.lua | 16 + spec/Features/Money_spec.lua | 62 +++- spec/Features/Professions_spec.lua | 43 +++ spec/Features/Reputation_spec.lua | 59 ++- spec/GameTesting/TestMode_spec.lua | 21 ++ .../LootDisplayFrame_spec.lua | 21 ++ .../LootDisplayRow/LootDisplayRow_spec.lua | 21 ++ spec/RPGLootFeed_spec.lua | 19 - spec/common_stubs.lua | 337 +++++++++++++++-- spec/config/Features_spec.lua | 2 +- spec/utils/AddonMethods_spec.lua | 138 +++++++ spec/utils/AlphaHelpers_spec.lua | 44 +++ spec/{ => utils}/DoubleLinkedList_spec.lua | 22 +- spec/utils/Enums_spec.lua | 29 ++ spec/utils/ItemInfo_spec.lua | 321 +++++++++++++++++ spec/utils/Logger_spec.lua | 92 +++++ spec/utils/Maps_spec.lua | 25 ++ spec/utils/Queue_spec.lua | 97 +++++ utils/AddonMethods.lua | 109 ++++++ utils/AlphaHelpers.lua | 43 +++ .../DoubleLinkedList.lua | 0 utils/Enums.lua | 45 +++ utils/ItemInfo.lua | 72 ++++ Logger.lua => utils/Logger.lua | 202 ++++++----- utils/Maps.lua | 41 +++ Queue.lua => utils/Queue.lua | 0 utils/utils.xml | 12 + 73 files changed, 3905 insertions(+), 1074 deletions(-) create mode 100644 .python-version create mode 100644 BlizzOverrides/retryHook.lua delete mode 100644 Features/ItemLoot.lua create mode 100644 Features/ItemLoot/AuctionIntegrations.lua create mode 100644 Features/ItemLoot/ItemLoot.lua create mode 100644 Features/ItemLoot/ItemLoot.xml create mode 100644 Features/Professions.lua create mode 100644 GameTesting/IntegrationTest.lua rename LootDisplayProfiler.lua => GameTesting/Profiling.lua (100%) rename SmokeTest.lua => GameTesting/SmokeTest.lua (73%) rename TestMode.lua => GameTesting/TestMode.lua (59%) create mode 100644 GameTesting/testing.xml delete mode 100644 RPGLootFeed.lua rename config/{ => Features}/Features.lua (80%) create mode 100644 config/Features/ItemConfig.lua create mode 100644 config/Features/features.xml create mode 100644 spec/BlizzOverrides/MoneyAlerts_spec.lua create mode 100644 spec/BlizzOverrides/retryHook_spec.lua create mode 100644 spec/Features/LootDisplayProperties_spec.lua create mode 100644 spec/Features/Professions_spec.lua create mode 100644 spec/GameTesting/TestMode_spec.lua create mode 100644 spec/LootDisplay/LootDisplayFrame/LootDisplayFrame_spec.lua create mode 100644 spec/LootDisplay/LootDisplayFrame/LootDisplayRow/LootDisplayRow_spec.lua delete mode 100644 spec/RPGLootFeed_spec.lua create mode 100644 spec/utils/AddonMethods_spec.lua create mode 100644 spec/utils/AlphaHelpers_spec.lua rename spec/{ => utils}/DoubleLinkedList_spec.lua (84%) create mode 100644 spec/utils/Enums_spec.lua create mode 100644 spec/utils/ItemInfo_spec.lua create mode 100644 spec/utils/Logger_spec.lua create mode 100644 spec/utils/Maps_spec.lua create mode 100644 spec/utils/Queue_spec.lua create mode 100644 utils/AddonMethods.lua create mode 100644 utils/AlphaHelpers.lua rename DoubleLinkedList.lua => utils/DoubleLinkedList.lua (100%) create mode 100644 utils/Enums.lua create mode 100644 utils/ItemInfo.lua rename Logger.lua => utils/Logger.lua (65%) create mode 100644 utils/Maps.lua rename Queue.lua => utils/Queue.lua (100%) create mode 100644 utils/utils.xml 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"> +