View Single Post
01-18-20, 09:53 AM   #37
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Add
Code:
statusText:SetDrawLayer("OVERLAY", 7)
after your ClearAllPoints/SetPoint calls
Code:
hooksecurefunc("DefaultCompactUnitFrameSetup", function(self)
	local fontSize = 12 * min(DefaultCompactUnitFrameSetupOptions.height / 36, DefaultCompactUnitFrameSetupOptions.width / 72)
	local statusText = self.statusText
	statusText:SetFont("Fonts\\ARIALN.TTF", fontSize)
	statusText:SetHeight(fontSize)
	statusText:SetShadowColor(0, 0, 0, 1)
	statusText:SetShadowOffset(1, -1)
	statusText:ClearAllPoints()
	statusText:SetPoint("CENTER", 0, -10)
	statusText:SetDrawLayer("OVERLAY", 7)
end)

hooksecurefunc("CompactUnitFrame_UpdateStatusText", function(self)
	local statusText = self.statusText
	if statusText and statusText:IsShown() then
		if self.optionTable.healthText == "losthealth" and tonumber(statusText:GetText() or "") then
			if not statusText.colorOverridden then
				statusText.colorOverridden = true
				statusText:SetTextColor(0.95, 0.1, 0.1, 1)
			end
		elseif statusText.colorOverridden then
			statusText.colorOverridden = nil
			statusText:SetTextColor(0.5, 0.5, 0.5, 1)
		end
	end
end)
  Reply With Quote