Status Text Hide on Player Frame when set to both

Hey everyone, i had this addon in Dragonflight, but it’s not work in TWW pre-patch, maybe somebody can fix this for me?

local textStrings = {
player = {
PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.HealthBarArea.HealthBar.TextString,
PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.HealthBarArea.HealthBar.LeftText,
PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.HealthBarArea.HealthBar.RightText,
PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.ManaBarArea.ManaBar.TextString,
PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.ManaBarArea.ManaBar.LeftText,
PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.ManaBarArea.ManaBar.RightText
},
pet = {
PetFrameHealthBar.TextString,
PetFrameHealthBar.LeftText,
PetFrameHealthBar.RightText,
PetFrameManaBar.TextString,
PetFrameManaBar.LeftText,
PetFrameManaBar.RightText
}
}

local function alphaText(which,alpha)
for _,fontstring in ipairs(textStrings[which]) do
fontstring:SetAlpha(alpha)
end
end
local function showText(which)
alphaText(which,1)
end
local function hideText(which)
alphaText(which,0)
end
local function hookFrame(which,frame)
frame:HookScript(“OnEnter”,function(self) showText(which) end)
frame:HookScript(“OnLeave”,function(self) hideText(which) end)
hideText(which)
end
hookFrame(“player”,PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.HealthBarArea.HealthBar)
hookFrame(“player”,PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.ManaBarArea.ManaBar)
hookFrame(“player”,PlayerFrame)
hookFrame(“pet”,PetFrameHealthBar)
hookFrame(“pet”,PetFrameManaBar)
hookFrame(“pet”,PetFrame)

What errors is it throwing?

Here you go:

local textStrings = {
	player = {
		PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.HealthBarsContainer.HealthBar.TextString,
		PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.HealthBarsContainer.HealthBar.LeftText,
		PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.HealthBarsContainer.HealthBar.RightText,
		PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.ManaBarArea.ManaBar.TextString,
		PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.ManaBarArea.ManaBar.LeftText,
		PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.ManaBarArea.ManaBar.RightText
	},
	pet = {
		PetFrameHealthBar.TextString,
		PetFrameHealthBar.LeftText,
		PetFrameHealthBar.RightText,
		PetFrameManaBar.TextString,
		PetFrameManaBar.LeftText,
		PetFrameManaBar.RightText
	}
}

local function alphaText(which,alpha)
	for _,fontstring in ipairs(textStrings[which]) do
		fontstring:SetAlpha(alpha)
	end
end
local function showText(which)
	alphaText(which,1)
end
local function hideText(which)
	alphaText(which,0)
end

local function hookFrame(which,frame)
	frame:HookScript("OnEnter",function(self) showText(which) end)
	frame:HookScript("OnLeave",function(self) hideText(which) end)
	hideText(which)
end

hookFrame("player",PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.HealthBarsContainer.HealthBar)
hookFrame("player",PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.ManaBarArea.ManaBar)
hookFrame("player",PlayerFrame)
hookFrame("pet",PetFrameHealthBar)
hookFrame("pet",PetFrameManaBar)
hookFrame("pet",PetFrame)
2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.