N00bZXI
01-13-2007, 11:06 PM
Assuming the frame names are Nurfed_hudplayer and Nurfed_hudtarget, add this to the end of layout.lua
If you need want to fade more frames, add them to the table.
local function hudalpha()
if event == "UNIT_HEALTH" and arg1 ~= "player" then return end
for _,v in pairs( { Nurfed_hudplayer, Nurfed_hudtarget } ) do
if not UnitAffectingCombat("player") then
if not UnitName("target") then
if UnitHealth("player") == UnitHealthMax("player") then
v:SetAlpha(0)
else
v:SetAlpha(0.7)
end
else
v:SetAlpha(0.7)
end
else
v:SetAlpha(1.0)
end
end
end
local f=CreateFrame("FRAME")
f:RegisterEvent("PLAYER_REGEN_DISABLED")
f:RegisterEvent("PLAYER_REGEN_ENABLED")
f:RegisterEvent("UNIT_HEALTH")
f:RegisterEvent("PlAYER_TARGET_CHANGED")
f:SetScript("OnEvent", hudalpha )
Set your hud alpha to zero in the layout.
edit: If this is not how the would show/hide pre-2.0 - please let me know!
If you need want to fade more frames, add them to the table.
local function hudalpha()
if event == "UNIT_HEALTH" and arg1 ~= "player" then return end
for _,v in pairs( { Nurfed_hudplayer, Nurfed_hudtarget } ) do
if not UnitAffectingCombat("player") then
if not UnitName("target") then
if UnitHealth("player") == UnitHealthMax("player") then
v:SetAlpha(0)
else
v:SetAlpha(0.7)
end
else
v:SetAlpha(0.7)
end
else
v:SetAlpha(1.0)
end
end
end
local f=CreateFrame("FRAME")
f:RegisterEvent("PLAYER_REGEN_DISABLED")
f:RegisterEvent("PLAYER_REGEN_ENABLED")
f:RegisterEvent("UNIT_HEALTH")
f:RegisterEvent("PlAYER_TARGET_CHANGED")
f:SetScript("OnEvent", hudalpha )
Set your hud alpha to zero in the layout.
edit: If this is not how the would show/hide pre-2.0 - please let me know!