mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-22 15:46:56 +00:00
34f5c3eb02
Bugfixes: - Fixed 40-yard range check not working for raid/party frames - Fixed aggro indicator not displaying properly on raid/party frames - Improved aggro cache to only cache positive results for instant detection - Fixed HP/Mana not updating with "Use Raid Frames for group" enabled - Added SuperWoW nil-check for SpellInfo - Added missing events: PARTY_MEMBER_ENABLE, PARTY_MEMBER_DISABLE, PLAYER_UPDATE_RESTING UI Improvements: - Share/Hoverbind buttons now show warning when module is disabled
30 lines
999 B
Lua
30 lines
999 B
Lua
pfUI:RegisterModule("feigndeath", "vanilla:tbc", function ()
|
|
local cache = { }
|
|
local scanner = libtipscan:GetScanner("feigndeath")
|
|
local healthbar = scanner:GetChildren()
|
|
|
|
local cache_update = CreateFrame("Frame")
|
|
cache_update:RegisterEvent("UNIT_HEALTH")
|
|
cache_update:RegisterEvent("PLAYER_TARGET_CHANGED")
|
|
cache_update:SetScript("OnEvent", function()
|
|
if event == "PLAYER_TARGET_CHANGED" and UnitIsDead("target") then
|
|
scanner:SetUnit("target")
|
|
cache[UnitName("target")] = healthbar:GetValue()
|
|
elseif event == "UNIT_HEALTH" and UnitIsDead(arg1) and UnitName(arg1) then
|
|
scanner:SetUnit(arg1)
|
|
cache[UnitName(arg1)] = healthbar:GetValue()
|
|
elseif event == "UNIT_HEALTH" and UnitName(arg1) then
|
|
cache[UnitName(arg1)] = nil
|
|
end
|
|
end)
|
|
|
|
local oldUnitHealth = UnitHealth
|
|
function UnitHealth(arg)
|
|
if UnitIsDead(arg) and cache[UnitName(arg)] then
|
|
return cache[UnitName(arg)]
|
|
else
|
|
return oldUnitHealth(arg)
|
|
end
|
|
end
|
|
end)
|