Skip to content

Commit 5874c2e

Browse files
authored
Merge pull request #22 from Obsouleet/patch-1
2 parents dba293d + 6f726fa commit 5874c2e

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.luacheckrc

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ stds.wow = {
2929
"CreateFrame",
3030
"date",
3131
"DEFAULT_CHAT_FRAME",
32+
"Enum",
3233
"GetServerTime",
3334
"FauxScrollFrame_GetOffset",
3435
"FauxScrollFrame_OnVerticalScroll",
@@ -54,6 +55,7 @@ stds.wow = {
5455
"SOUNDKIT",
5556
"StaticPopup_Show",
5657
"time",
58+
"TooltipDataProcessor",
5759
"UIParent",
5860
"UnitCanAttack",
5961
"UnitExists",
@@ -65,7 +67,9 @@ stds.wow = {
6567
"UnitName",
6668
"UnitXP",
6769
"UnitXPMax",
68-
"wipe"
70+
"wipe",
71+
"WOW_PROJECT_ID",
72+
"WOW_PROJECT_MAINLINE"
6973
}
7074
}
7175

KillTrack.lua

+8-2
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ function KT.Events.ENCOUNTER_END(self, _, _, _, size)
275275
end
276276
end
277277

278-
GameTooltip:HookScript("OnTooltipSetUnit", function(self)
278+
local function tooltip_enhancer(self)
279279
if not KT.Global.TOOLTIP then return end
280280
local _, unit = self:GetUnit()
281281
if not unit then return end
@@ -296,7 +296,13 @@ GameTooltip:HookScript("OnTooltipSetUnit", function(self)
296296
self:AddLine(("ID = %d"):format(id))
297297
end
298298
self:Show()
299-
end)
299+
end
300+
301+
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
302+
TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Unit, tooltip_enhancer)
303+
else
304+
GameTooltip:HookScript("OnTooltipSetUnit", tooltip_enhancer)
305+
end
300306

301307
function KT:ToggleLoadMessage()
302308
self.Global.LOAD_MESSAGE = not self.Global.LOAD_MESSAGE

0 commit comments

Comments
 (0)