FrameXML/Cooldown.xml has the corresponding template.
But in that template is no FontString described.
So here is the button from the InterfaceOptionPanels.xml
Code:
<CheckButton name="$parentCountdownCooldowns" inherits="InterfaceOptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentSecureAbilityToggle" relativePoint="BOTTOMLEFT" x="0" y="-8"/>
</Anchors>
<Scripts>
<OnLoad>
self.type = CONTROLTYPE_CHECKBOX;
self.cvar = "countdownForCooldowns";
BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
</OnLoad>
</Scripts>
</CheckButton>
In the Lua: countdownForCooldowns = "
COUNTDOWN_FOR_COOLDOWNS_TEXT"
Problem is. That CVAR is nowhere being used. Thus I assume it is added C-side?!
But we could try parsing the button regions.
lua Code:
local function CheckRegions(f)
for _, child in pairs({ f:GetChildren() }) do
CheckRegions(child)
end
for _, region in pairs({ f:GetRegions() }) do
print("region",region:GetName(),region:GetObjectType())
end
end
CheckRegions(ActionButton1)
macro
Code:
/run local function CR(f) for _,c in pairs({f:GetChildren()}) do CR(c) end for _,r in pairs({f:GetRegions()}) do print("region",r:GetName(),r:GetObjectType()) end end; CR(ActionButton1)
Ok I got it. macro
Code:
/run local function CR(f) for _,c in pairs({f:GetChildren()}) do CR(c) end for _,r in pairs({f:GetRegions()}) do if r:GetObjectType() == "FontString" then print("region",r:GetName(),r:GetFont(),r:GetText()) end end end; CR(ActionButton1)
I ran a cooldown on button1 and there is a fontstring that has no name. But the text it is spitting out is exactly my cooldown.
If you disable the interface option the font string is still there.
I checked the child name. So the child that is inheriting the fontstring is _G["ActionButton1Cooldown"]. Easy as that. Parse over all actionbutton cooldowns and track down that fontstring. Actionally making it accessable via key would be best. Actionbuttons have a key for the cooldown child: Actionbutton1.cooldown would be your cooldown frame.
Tested it. It is working properly.
Lua Code:
local bu = ActionButton1
for _, region in next, {bu.cooldown:GetRegions()} do
if region:GetObjectType() == "FontString" then
bu.cooldown.cooldownText = region
end
end
bu.cooldown.cooldownText:SetFont(cfg.font, cfg.hotkeys.fontsize, "OUTLINE")
Btw. Tuller is hooking OnSizeChanced on the cooldown and adjusts the size of the cooldown text based on button size/scale. Pretty important if your cooldowns on buffs become huge.
I would still use OmniCC/tullaCC any day long instead.