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)
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)
do you think you could help me fix this after patch today?
hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(statusFrame, textString, value, valueMin, valueMax)
if valueMax > 0 then
textString:SetText(tostring(AbbreviateLargeNumbers(value)).."");
else
textString:SetText("0");
end
if(statusFrame.LeftText and statusFrame.RightText) then
statusFrame.LeftText:Hide();
statusFrame.RightText:Hide();
textString:Show();
end
end)