From 678bcdd1e3c9d38d1564848450d29b6852871d60 Mon Sep 17 00:00:00 2001 From: Obsouleet Date: Fri, 18 Nov 2022 13:44:06 +0100 Subject: [PATCH 1/4] Update KillTrack.lua Gametooltip saw a lot changes in 10.0.2 - unfortunately this broke the addon. --- KillTrack.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KillTrack.lua b/KillTrack.lua index 5dd06f2..0043da6 100644 --- a/KillTrack.lua +++ b/KillTrack.lua @@ -275,7 +275,7 @@ function KT.Events.ENCOUNTER_END(self, _, _, _, size) end end -GameTooltip:HookScript("OnTooltipSetUnit", function(self) +TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Unit,function(self, data) if not KT.Global.TOOLTIP then return end local _, unit = self:GetUnit() if not unit then return end From 60469ae6b5addc6ee2da1763f159fe0aca909148 Mon Sep 17 00:00:00 2001 From: Adam Hellberg Date: Fri, 2 Dec 2022 19:44:09 +0100 Subject: [PATCH 2/4] Fix some formatting --- KillTrack.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KillTrack.lua b/KillTrack.lua index 0043da6..5746014 100644 --- a/KillTrack.lua +++ b/KillTrack.lua @@ -275,7 +275,7 @@ function KT.Events.ENCOUNTER_END(self, _, _, _, size) end end -TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Unit,function(self, data) +TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Unit, function(self) if not KT.Global.TOOLTIP then return end local _, unit = self:GetUnit() if not unit then return end From 118703c2cdecb2693c97a705372569fd4ac0ff78 Mon Sep 17 00:00:00 2001 From: Adam Hellberg Date: Fri, 2 Dec 2022 19:45:10 +0100 Subject: [PATCH 3/4] Add missing WoW globals --- .luacheckrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.luacheckrc b/.luacheckrc index 1e36f64..cfee5cc 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -29,6 +29,7 @@ stds.wow = { "CreateFrame", "date", "DEFAULT_CHAT_FRAME", + "Enum", "GetServerTime", "FauxScrollFrame_GetOffset", "FauxScrollFrame_OnVerticalScroll", @@ -54,6 +55,7 @@ stds.wow = { "SOUNDKIT", "StaticPopup_Show", "time", + "TooltipDataProcessor", "UIParent", "UnitCanAttack", "UnitExists", From 6f726fa03d25fc2ec9ceb3af6b1c92169a1a699f Mon Sep 17 00:00:00 2001 From: Adam Hellberg Date: Fri, 2 Dec 2022 19:48:07 +0100 Subject: [PATCH 4/4] Fix new tooltip code for classic clients --- .luacheckrc | 4 +++- KillTrack.lua | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index cfee5cc..265af05 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -67,7 +67,9 @@ stds.wow = { "UnitName", "UnitXP", "UnitXPMax", - "wipe" + "wipe", + "WOW_PROJECT_ID", + "WOW_PROJECT_MAINLINE" } } diff --git a/KillTrack.lua b/KillTrack.lua index 5746014..f3b249a 100644 --- a/KillTrack.lua +++ b/KillTrack.lua @@ -275,7 +275,7 @@ function KT.Events.ENCOUNTER_END(self, _, _, _, size) end end -TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Unit, function(self) +local function tooltip_enhancer(self) if not KT.Global.TOOLTIP then return end local _, unit = self:GetUnit() if not unit then return end @@ -296,7 +296,13 @@ TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Unit, function(self self:AddLine(("ID = %d"):format(id)) end self:Show() -end) +end + +if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then + TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Unit, tooltip_enhancer) +else + GameTooltip:HookScript("OnTooltipSetUnit", tooltip_enhancer) +end function KT:ToggleLoadMessage() self.Global.LOAD_MESSAGE = not self.Global.LOAD_MESSAGE