diff --git a/.luacheckrc b/.luacheckrc index 1e36f64..265af05 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", @@ -65,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 5dd06f2..f3b249a 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) +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 @@ GameTooltip:HookScript("OnTooltipSetUnit", 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