Player & target health text

It looks like they’ve gotten rid of using global functions for most statusbars and are using a Mixin for each one instead which means you would have to hook the individual function for each bar you want to effect (the new unit frame structures also make it pretty ugly and given they are not identical makes it even uglier).

Eg. for the PlayerFrame and TargetFrame health and mana bars you could use:

local function UpdateBarText(self, textString, value, valueMin, valueMax)
    if valueMax > 0 then
        textString:SetText(tostring(AbbreviateLargeNumbers(value)).."");
    else
        textString:SetText("0");
    end
    if(self.LeftText and self.RightText) then
        self.LeftText:Hide();
        self.RightText:Hide();
        textString:Show();
    end
end

hooksecurefunc(PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.HealthBarArea.HealthBar, "UpdateTextStringWithValues", UpdateBarText)
hooksecurefunc(TargetFrame.TargetFrameContent.TargetFrameContentMain.HealthBar, "UpdateTextStringWithValues", UpdateBarText)
hooksecurefunc(PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.ManaBarArea.ManaBar, "UpdateTextStringWithValues", UpdateBarText)
hooksecurefunc(TargetFrame.TargetFrameContent.TargetFrameContentMain.ManaBar, "UpdateTextStringWithValues", UpdateBarText)

I have’t dug into the makeup of the text status bar to see if that has changed.

2 Likes