Skip to content

Commit

Permalink
Merge pull request #22 from Obsouleet/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharparam authored Dec 2, 2022
2 parents dba293d + 6f726fa commit 5874c2e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ stds.wow = {
"CreateFrame",
"date",
"DEFAULT_CHAT_FRAME",
"Enum",
"GetServerTime",
"FauxScrollFrame_GetOffset",
"FauxScrollFrame_OnVerticalScroll",
Expand All @@ -54,6 +55,7 @@ stds.wow = {
"SOUNDKIT",
"StaticPopup_Show",
"time",
"TooltipDataProcessor",
"UIParent",
"UnitCanAttack",
"UnitExists",
Expand All @@ -65,7 +67,9 @@ stds.wow = {
"UnitName",
"UnitXP",
"UnitXPMax",
"wipe"
"wipe",
"WOW_PROJECT_ID",
"WOW_PROJECT_MAINLINE"
}
}

Expand Down
10 changes: 8 additions & 2 deletions KillTrack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5874c2e

Please sign in to comment.