View Single Post
01-05-20, 05:29 PM   #16
jeruku
A Cobalt Mageweaver
 
jeruku's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 223
Sorry about that. Else is used when falling back and since it wouldn't be overridden setting the flag makes no difference so it should look something like this.

Lua Code:
  1. hooksecurefunc("CompactUnitFrame_UpdateStatusText", function(self)
  2.     local statusText = self.statusText
  3.     if statusText and statusText:IsShown() then
  4.         if self.optionTable.healthText == "losthealth" and tonumber(statusText:GetText() or "") and not statusText.fontOverridden then
  5.             statusText.fontOverridden = true
  6.             statusText:SetFont("Fonts\\ARIALN.TTF", 16)
  7.             statusText:SetTextColor(0.95, 0.2, 0.2)
  8.             statusText:SetShadowColor(0, 0, 0, 1)
  9.             statusText:SetShadowOffset(1, -1)
  10.         else
  11.             statusText.fontOverridden = nil
  12.             statusText:SetFont("Fonts\\ARIALN.TTF", 16)
  13.             statusText:SetTextColor(0.5, 0.5, 0.5)
  14.             statusText:SetShadowColor(0, 0, 0, 1)
  15.             statusText:SetShadowOffset(1, -1)
  16.         end
  17.     end
  18. end)
__________________
"I have not failed, I simply found 10,000 ways that did not work." - Thomas Edison
  Reply With Quote