Quantcast
Raidframe HealPrediction Texture - WoWInterface
Thread Tools Display Modes
05-06-21, 11:09 PM   #1
rulezyx
A Warpwood Thunder Caller
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 93
Raidframe HealPrediction Texture

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.
Attached Thumbnails
Click image for larger version

Name:	132.png
Views:	21
Size:	8.2 KB
ID:	9622  
Attached Images
 
  Reply With Quote
05-07-21, 12:06 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,418
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()?
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
05-07-21, 07:27 AM   #3
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Originally Posted by Fizzlemizz View Post
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)
  Reply With Quote
05-07-21, 07:48 AM   #4
rulezyx
A Warpwood Thunder Caller
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 93
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:
Attached Images
 

Last edited by rulezyx : 05-07-21 at 07:53 AM.
  Reply With Quote
05-07-21, 07:51 AM   #5
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,638
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.


Originally Posted by rulezyx View Post
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:
__________________

Last edited by Xrystal : 05-07-21 at 07:55 AM.
  Reply With Quote
05-07-21, 08:12 AM   #6
rulezyx
A Warpwood Thunder Caller
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 93
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?

Last edited by rulezyx : 05-07-21 at 08:52 AM.
  Reply With Quote
05-07-21, 08:54 AM   #7
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,418
Gradients seem pretty sticky. Maybe just hide the original texture and replace it with a new one.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
05-07-21, 09:33 AM   #8
rulezyx
A Warpwood Thunder Caller
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 93
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.

Last edited by rulezyx : 05-07-21 at 09:38 AM.
  Reply With Quote
05-07-21, 09:58 AM   #9
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,418
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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 05-07-21 at 10:05 AM.
  Reply With Quote
05-07-21, 10:09 AM   #10
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
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)
  Reply With Quote
05-07-21, 11:17 AM   #11
rulezyx
A Warpwood Thunder Caller
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 93
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

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

Last edited by rulezyx : 05-07-21 at 11:45 AM.
  Reply With Quote
05-07-21, 11:43 AM   #12
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Originally Posted by rulezyx View Post
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)
Originally Posted by rulezyx View Post
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)
Originally Posted by rulezyx View Post
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.

Last edited by Vrul : 05-07-21 at 11:46 AM.
  Reply With Quote
05-07-21, 11:50 AM   #13
rulezyx
A Warpwood Thunder Caller
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 93
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.
  Reply With Quote
05-07-21, 11:58 AM   #14
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
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.
  Reply With Quote
05-07-21, 02:06 PM   #15
rulezyx
A Warpwood Thunder Caller
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 93
Seems to work fine I just have to play around with the colors

Thank you for your help!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Raidframe HealPrediction Texture

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off