WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Raidframe HealPrediction Texture (https://www.wowinterface.com/forums/showthread.php?t=58722)

rulezyx 05-06-21 11:09 PM

Raidframe HealPrediction Texture
 
2 Attachment(s)
Hello,

I am trying to change the default CompactRaidFrameXMyHealPrediction texture but I cant find any path related to it:

frame.myHealPrediction
frame.otherHealPrediction

My Problem is that it still has the default texture (curved-shadow) and I am playing with a Matt Texture replacement for my Raidframes.

Blizzard-Code: https://github.com/tomrus88/Blizzard...rame.lua#L1628

It is not possible to replace it with just :SetTexture.

If someone has an idea about how it works and maybe how to change it I would appreciate any help. :)

Fizzlemizz 05-07-21 12:06 AM

Code:

frame.myHealPrediction:SetGradient("VERTICAL", 8/255, 93/255, 72/255, 11/255, 136/255, 105/255);
Is being used.

Never used it so I don't know how to clear it frame.myHealPrediction:SetGradient()?

Vrul 05-07-21 07:27 AM

Quote:

Originally Posted by Fizzlemizz (Post 339051)
Never used it so I don't know how to clear it frame.myHealPrediction:SetGradient()?

This should remove the gradient:
Lua Code:
  1. frame.myHealPrediction:SetGradient("VERTICAL", 255, 255, 255, 255, 255, 255)

rulezyx 05-07-21 07:48 AM

1 Attachment(s)
Thank you both for the fast reply.

Thats my fault and I missed that when I was looking at their code.

I am used to have a texture path for my UI stuff but that makes perfect sense now.

So I tried to use it with one of my raidframe codes:
Code:

hooksecurefunc("CompactUnitFrame_UpdateName",function(frame)
if frame and not frame:IsForbidden() then
local frame_name = frame:GetName()
if frame_name and frame_name:match("^CompactRaidFrame%d") and frame.unit and frame.name then
local unit_name = GetUnitName(frame.unit,true)
if unit_name then
frame.name:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
frame.myHealPrediction:SetGradient("VERTICAL", 100, 100, 100, 100, 100, 100)
end
end
end
end)

I am sure I need to change some of the values but when I do that the effect/curve appears again.

So no matter what value I put in there as long as it is always the same one it appears to be just white:

Xrystal 05-07-21 07:51 AM

Try changing the numbers in the SetGradient function. I suspect the first 3 numbers are the red,green,blue percentages for color 1 and the last 3 for color 2. So in theory:

frame.myHealPrediction:SetGradient("VERTICAL", 100, 0, 0, 0, 100,0)

Would have a gradient going from red to green.

Edit:
Just found this on another post here.
SetGradientAlpha("VERTICAL", 1, 1, 1, 0, 1, 1, 1, .6)

Sounds like this sets the color gradient and the alpha so maybe change the 4th and 8th values to 0 for full alpha or 1 for full color etc.


Quote:

Originally Posted by rulezyx (Post 339054)
Thank you both for the fast reply.

Thats my fault and I missed that when I was looking at their code.

I am used to have a texture path for my UI stuff but that makes perfect sense now.

So I tried to use it with one of my raidframe codes:
Code:

hooksecurefunc("CompactUnitFrame_UpdateName",function(frame)
if frame and not frame:IsForbidden() then
local frame_name = frame:GetName()
if frame_name and frame_name:match("^CompactRaidFrame%d") and frame.unit and frame.name then
local unit_name = GetUnitName(frame.unit,true)
if unit_name then
frame.name:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
frame.myHealPrediction:SetGradient("VERTICAL", 100, 100, 100, 100, 100, 100)
end
end
end
end)

But no matter what value I put in there it always appears to be just white:


rulezyx 05-07-21 08:12 AM

Ok I get that and I am able to change the color but I want to completely get rid of the gradient (make it matt/clean and green as before/not white) which seems to be a bit tricky.

I only found:
Texture:SetGradient(orientation, minR, minG, minB, maxR, maxG, maxB)
Texture:SetGradientAlpha(orientation, minR, minG, minB, minA, maxR, maxG, maxB, maxA)
and your post related to it: https://www.wowinterface.com/forums/...ad.php?t=32696

So according to that I guess it should be a pattern like:

frame.myHealPrediction:SetGradient("VERTICAL", 0, 0, 1, 0, 0, 1, 0)
appears to be just blue and:
frame.myHealPrediction:SetGradient("VERTICAL", 0, 1, 1, 0, 1, 1, 0)
appears to be a rly light blue but I am still confused and it doesnt matter how high I set the values.

I am able to make it completely black with just zeros like just ones for white but without changing the first digit (orientation) theres only blue, black and white?

Fizzlemizz 05-07-21 08:54 AM

Gradients seem pretty sticky. Maybe just hide the original texture and replace it with a new one.

rulezyx 05-07-21 09:33 AM

Yep, if theres no other way to change colors but I dont know how to do it.

For example I used to just:
PlayerFrameMyHealPredictionBar:SetTexture("Interface\...)

with my UI Textures which works fine but that doesn't seem to work that easy for the CompactRaidFrames and I really want to keep it clean.

Pretty much nobody ever changed this part of the default raidframes and I have no snippet for it.

Usually I put snippets together/rip out codes.

I used to replace default textures in the past with just:

Code:

for _, sb in pairs ({
        TargetFrameHealthBar,
        TargetFrameManaBar,
        GameTooltipStatusBar       
        })        do
                sb:SetStatusBarTexture("Interface\\AddOns\\HpPp\\statusbar")
        end

or with changing texture folders / placing weakauras.

Fizzlemizz 05-07-21 09:58 AM

Code:

frame.myHealPrediction:Hide()
frame.myHealPrediction = frame:CreateTexture()

Then set your texture should do it as all the CRF code appears to use the parentKey and not the frame name.

Vrul 05-07-21 10:09 AM

It seems that SetColorTexture respects any SetGradient in place but SetVertexColor overrides SetGradient. Since SetColorTexture is set to pure white by default we just need to use SetVertexColor to set the average of the gradient. Untested code:
Lua Code:
  1. hooksecurefunc("DefaultCompactUnitFrameSetup", function(frame)
  2.     frame.myHealPrediction:SetVertexColor(19/510, 229/510, 177/510)
  3.     frame.otherHealPrediction:SetVertexColor(32/510, 142/510, 115/510)
  4. end)
  5.  
  6. hooksecurefunc("DefaultCompactMiniFrameSetup", function(frame)
  7.     frame.myHealPrediction:SetVertexColor(19/510, 229/510, 177/510)
  8.     frame.otherHealPrediction:SetVertexColor(5/510, 5173/510, 23/510)
  9. end)

rulezyx 05-07-21 11:17 AM

The code seems to fix the color and is working without any issues.

Somehow default raidframe related stuff is always a bit messy.

I get the color and gradient/effect stuff but I still dont understand where the texture (length/size) came from:confused:

Maybe I am missing something and its just color but I am a bit confused because for shield/absorb theres a Raidframe Texture called "Shield-Overlay".

It would be pretty nice if I could change the white-texture to my statusbar/health-texture like the rest of my UI.

It is the same texture as everything health related like: Interface/RaidFrame/Raid-Bar-Resource-Fill.blp

If that is even possible without making a mess.

Again thanks for all the help:)

Vrul 05-07-21 11:43 AM

Quote:

Originally Posted by rulezyx (Post 339062)
I get the color and gradient/effect stuff but I still dont understand where the texture (length/size) came from

The size is set via SetPoint calls in CompactUnitFrameUtil_UpdateFillBar. It is called as: CompactUnitFrameUtil_UpdateFillBar(frame, healthTexture, frame.myHealPrediction, myIncomingHeal, -myCurrentHealAbsorbPercent)
Quote:

Originally Posted by rulezyx (Post 339062)
Maybe I am missing something and its just color but I am a bit confused because for shield/absorb theres a Raidframe Texture called "Shield-Overlay".

The SetColorTexture(r, g, b) call creates a texture of uniform color. Before Blizzard added that you had to do:
Code:

tex:SetTexture([[Interface\BUTTONS\WHITE8X8]])
tex:SetVertexColor(r, g, b)

Quote:

Originally Posted by rulezyx (Post 339062)
It would be pretty nice if I could change the white-texture to my statusbar-texture like the rest of my UI.

You can. It is still just a normal texture like any other.

rulezyx 05-07-21 11:50 AM

Is it possible to use/place a different texture like the same as my raidframes (Raid-Bar-Hp-Fill.blp) instead?

For me it just disappears/does nothing when I try to set a different texture.

If it is alot of work I am fine with just the color based one but it would look a bit cleaner when I have the same as my UI-texture.

Vrul 05-07-21 11:58 AM

It should be something as simple as:
Lua Code:
  1. hooksecurefunc("DefaultCompactUnitFrameSetup", function(frame)
  2.     frame.myHealPrediction:SetTexture([[Raid-Bar-Hp-Fill.blp]])
  3.     frame.myHealPrediction:SetVertexColor(19/510, 229/510, 177/510)
  4.     frame.otherHealPrediction:SetTexture([[Raid-Bar-Hp-Fill.blp]])
  5.     frame.otherHealPrediction:SetVertexColor(32/510, 142/510, 115/510)
  6. end)
  7.  
  8. hooksecurefunc("DefaultCompactMiniFrameSetup", function(frame)
  9.     frame.myHealPrediction:SetTexture([[Raid-Bar-Hp-Fill.blp]])
  10.     frame.myHealPrediction:SetVertexColor(19/510, 229/510, 177/510)
  11.     frame.otherHealPrediction:SetTexture([[Raid-Bar-Hp-Fill.blp]])
  12.     frame.otherHealPrediction:SetVertexColor(5/510, 5173/510, 23/510)
  13. end)
Remove/change SetVertexColor as desired.

rulezyx 05-07-21 02:06 PM

Seems to work fine I just have to play around with the colors :)

Thank you for your help!


All times are GMT -6. The time now is 09:22 PM.

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