Quantcast
target/focus portrait flash/fade - WoWInterface
Thread Tools Display Modes
03-30-21, 08:13 AM   #1
rulezyx
A Flamescale Wyrmkin
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 106
target/focus portrait flash/fade

Hello,

with the default UI a player target- and focus-portrait will start to flash/fade when at lower health.

I guess it will start flashing under 15% hp and the fade starts under 30%.

Is it possible to disable this function somehow?

I couldnt find any CVar related to this.

Example (Portrait):
https://imgur.com/a/1FSuQqI

Last edited by rulezyx : 03-31-21 at 04:25 AM.
  Reply With Quote
04-01-21, 02:30 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,050
Looks like it's handled by TargetFrame_HealthUpdate(). It looks like it's safe to redirect to a dummy function. Other than that, there's no setting to configure it.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
04-01-21, 07:56 AM   #3
rulezyx
A Flamescale Wyrmkin
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 106
Thank you

I was looking up the same part of the code yesterday but I didnt thought it is related to that function/even copied it.

So theres no way to stop this from happening?

I was hoping/searching for a code/script but couldn't find anything related.

Since I am not good with lua (only ripping/editing codes) I am not sure if theres anything I can do about that.

The main reason for me is that it is not necessary, annoying and it can cause issues with other addons.

For example with BigDebuffs which shows icon/timers in portraits and the fade-function is messing with the alpha of the icons.

The Focus-Frame Portrait stays tainted even back at full health until manually refreshing and other things like that.

It would be great to just disable it somehow. If theres something to brute force this I would appreciate it.

Last edited by rulezyx : 04-01-21 at 08:14 AM.
  Reply With Quote
04-01-21, 11:53 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,050
Here's an example 0f what I was talking about; redirecting the function to a dummy function.
I added a couple other functions to redirect and a 4th to hook and reset the color.
Lua Code:
  1. --  Define a dummy function that literally does nothing
  2. local function DoNothing() end
  3.  
  4. --  Disable fade pulsing at <20% health
  5. TargetFrame_HealthUpdate=DoNothing;
  6.  
  7. --  Disable health-based portrait tinting
  8. TargetHealthCheck=DoNothing;
  9. TargetofTargetHealthCheck=DoNothing;
  10.  
  11. --  This one's trickier since we want faction textures to work
  12. --  Disable mob tap portrait fade
  13. hooksecurefunc("TargetFrame_CheckFaction",function(self)--  Secure-hook this function to run our own code after
  14. --  Note: This function runs from a template and portraits are optional
  15.     if self.portrait then self.portrait:SetVertexColor(1,1,1); end--    If portrait exists, set RGB filter to 100% on all channels
  16. end);
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
04-02-21, 05:31 AM   #5
rulezyx
A Flamescale Wyrmkin
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 106
Ty so much

I didnt even know that DoNothing exists.

That really makes disabling for not important functions much easier.

What I dont understand is the correlation between the TargetFrame and the FocusFrame related to these functions.

Why is the FocusFrame affected by the function and those changes when its not called at all?

It would make sense for me when I have to target something in order to get it on Focus but it is possible to do that with mouseover/scripts/macros and keybinds (arenas/bg) without targeting anything.

Maybe it is a stupid question but it would help me to understand the process.
  Reply With Quote
04-02-21, 03:43 PM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,050
Originally Posted by rulezyx View Post
I didnt even know that DoNothing exists.
It doesn't exist, the first thing the code does is create the function on line 2.
Blizzard has a similar function called nop(). You could use that instead if you prefer.


Originally Posted by rulezyx View Post
What I dont understand is the correlation between the TargetFrame and the FocusFrame related to these functions.

Why is the FocusFrame affected by the function and those changes when its not called at all?
They both "inherit" their properties from the same template. The only difference is when they're created, they're given different units to watch. Everything else is fundamentally the same. The first 3 functions are called from the template's event handler and the last one is called from its OnUpdate handler.



Originally Posted by rulezyx View Post
It would make sense for me when I have to target something in order to get it on Focus but it is possible to do that with mouseover/scripts/macros and keybinds (arenas/bg) without targeting anything.
Mainly macros, though mouseover is a type of macro and keybinds can be set to run macros. The only "no" in the list is scripts because of the limitations of calling these functions directly from Lua code.

Behind these are the /target and /focus commands. Both commands work the exact same way on their respective units and are very powerful when combined with macro conditionals.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
04-02-21, 06:10 PM   #7
rulezyx
A Flamescale Wyrmkin
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 106
Ok got it

Thank you for your help and the exact explanation.

Btw. I love your addons/work.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » target/focus portrait flash/fade

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