WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Is it possible to edit font of Cooldown frame that uses "CooldownFrameTemplate"? (https://www.wowinterface.com/forums/showthread.php?t=54075)

Layback_ 07-31-16 12:20 AM

Is it possible to edit font of Cooldown frame that uses "CooldownFrameTemplate"?
 
Hi all,

I was trying to edit font type and height of a Cooldown frame that utilizes "CooldownFrameTemplate".

Lua Code:
  1. local cd = CreateFrame("Cooldown", "$parentCoolDown", button, "CooldownFrameTemplate");
  2. cd:SetAllPoints(true);

However, I could have not figure it out how I would access to a text...

Could I please get some help regarding this?

Thank you.

Phanx 07-31-16 12:46 AM

lua Code:
  1. local text = cd:GetRegions()
  2. cd.text = text -- for easier access later

Layback_ 07-31-16 12:49 AM

Quote:

Originally Posted by Phanx (Post 317228)
lua Code:
  1. local text = cd:GetRegions()
  2. cd.text = text -- for easier access later

OMG! Thank you so much :)

SDPhantom 07-31-16 02:22 PM

I don't know if they changed this, but be aware the C code has been known to revert the settings on the built-in FontStrings on CooldownFrames every rendering pass.

Phanx 07-31-16 04:22 PM

I'm currently updating my oUF layout, and did something like this just to be safe:

Code:

local timer = cooldown:GetRegions()

timer:SetFontObject(GameFontHighlightSmall)
timer.SetFontObject = nop
timer.SetFont = nop

timer:ClearAllPoints()
timer.ClearAllPoints = nop

timer:SetPoint("CENTER", button, "TOP", 0, 0)
timer.SetPoint = nop

In limited testing I haven't seen anything reset. (nop is a "do nothing" function defined somewhere in Blizzard code.) I don't even know if the overrides are needed for the default cooldown text; I just reused the code I was previously using to manhandle OmniCC's timer text. If it doesn't actually reset, I'd just leave it alone.

SDPhantom 08-01-16 02:39 AM

I ran into it a long time ago when they first integrated it into the CooldownFrame. I was trying to change the color and reformat the text and neither worked. Even attempting to replace the SetText(), SetFormattedText(), and SetTextColor() proved to be futile. I think setting the font, size, and position were the only things I was able to do.


All times are GMT -6. The time now is 06:12 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI