WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Classic - AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=180)
-   -   Change font colour of the HP-text from Blizzard-Raid Frames (https://www.wowinterface.com/forums/showthread.php?t=57758)

rulezyx 01-05-20 11:12 PM

Ok I tried that but unfortunately nothing changed/happend.

I could just change the fontsize from 16 to 14 or something but when I switch to other profiles like for 5 or 10/20 man groups (Bigger Frames) the fontsize is still the same and doesnt match the size of the Frames at all (too small). Thats why I am asking.

Vrul 01-06-20 07:03 AM

Try changing the line (before the last change):
Code:

statusText:SetFont("Fonts\\ARIALN.TTF", 16)
to:
Code:

statusText:SetFont("Fonts\\ARIALN.TTF", 16 * min(DefaultCompactUnitFrameSetupOptions.height / 36, DefaultCompactUnitFrameSetupOptions.width / 72))

rulezyx 01-06-20 12:52 PM

I tried that but the size is still the same as before :(

Vrul 01-06-20 05:42 PM

Give this a shot:
Code:

hooksecurefunc("DefaultCompactUnitFrameSetup", function(self)
        local fontSize = 16 * 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)
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)


rulezyx 01-06-20 07:12 PM

I guess it did everything because the font-size is pretty much the same related/matched to all the frame profiles. I think I will go with 12 instead of 16 because its pretty big but I think thats it :)

Where do I put outline if I want to change that?

Vrul 01-06-20 07:32 PM

Same as before:
Code:

statusText:SetFont("Fonts\\ARIALN.TTF", fontSize, "OUTLINE")

rulezyx 01-06-20 08:37 PM

is it possible to make the outline smaller / thinner like with the shadow?

Vrul 01-06-20 08:42 PM

No. The only other option is "THICKOUTLINE" in place of "OUTLINE" which makes is thicker.

rulezyx 01-06-20 09:06 PM

Ok, ty so much :)

rulezyx 01-14-20 09:00 AM

change position
 
I was trying to display the text a bit lower because in default its directly in the middle of the frame. I use other mods to display buffs / heals on the other half and with bigger frames those are overlapping with lost-health text.

I tried: statusText:SetPoint("CENTER", 0, -10)

but that doesnt seem to work at all. :(

It seems the text is always locked to the middle of the frame. Any suggestions?:confused:

Seerah 01-14-20 01:16 PM

You need to clear it's original position first.

(:ClearAllPoints())

rulezyx 01-15-20 01:09 AM

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)
        :ClearAllPoints()
        statusText:SetPoint("CENTER", 0, -10)
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)

Ok I tried that but it doesnt matter if I put it to compact or default its still in the same position.

Maybe I missed something.

rulezyx 01-16-20 02:29 AM

I think the clear statement works but I dont know about setpoint. The text seems to be stuck there in the middle.:(

Vrul 01-16-20 04:37 AM

Code:

:ClearAllPoints()
should be
Code:

statusText:ClearAllPoints()

rulezyx 01-16-20 05:52 AM

Ok thats working :o Ty

rulezyx 01-18-20 05:17 AM

Is it possible to put the text in the foreground? Sometimes with bigger numbers its behind an aura/buff. is there a way to fix that?

Vrul 01-18-20 09:53 AM

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)


rulezyx 01-18-20 01:36 PM

Ok I tried that but the text is still behind the buffs/auras/debuffs. No issues but nothing is changing.

Also it happens that the text-position is different for some player frames (resettet, from what I changed it to in the first place)
And the outline is missing too (which I added). But I think thats related to the sort per role/name/group option.

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, "OUTLINE")
        statusText:SetHeight(fontSize)
        statusText:SetShadowColor(0, 0, 0, 1)
        statusText:SetShadowOffset(1, -1)
        statusText:ClearAllPoints()
        statusText:SetPoint("CENTER", 0, -6)
        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)


rulezyx 01-20-20 02:32 PM

Ok, so I tried to hide the auras/buffs instead. It seems that the layer isnt changeable like that. The numbers/text is always behind the buffs/auras.:confused::(


All times are GMT -6. The time now is 02:00 AM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2021 MMOUI