Status Text Hide on Player Frame when set to both?

Hello all.

I found this from @Gello on a post a few weeks ago. I was wondering if anyone could help me alter it. Right now it only works when numerical or percentage is selected. it doesn’t work when status text is set to both. Any help would greatly be appreciated!

local textStrings = {
player = {
PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.HealthBarArea.HealthBar.TextString,
PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.ManaBarArea.ManaBar.TextString
},
pet = {
PetFrameHealthBar.TextString,
PetFrameManaBar.TextString
}
}
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)

Originally posted on: Hide player status text (HP/mana) unless moused over

<3

bump still seeking help.

I would take a look but not using the default unit frames, I have no idea where to find the option(s) to select numerical or percentage or both for the frames required.

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)
4 Likes

gello, from the bottom of my heart. thank you so much!!!