Thread Tools Display Modes
04-29-18, 03:07 AM   #1
GreyFox777
A Cliff Giant
Join Date: Jan 2017
Posts: 75
Range check

Hello guys, can you help me please?

Im trying to make the range check for party1target, but it should parent to party1 frame.

How it works for me:

If player are too far away from party1 then party1 alpha is 0.6
If the target of party1 not too far away, then alpha is set to 1.

But it should work, like so:

If party1target is in range but party1 not, then it should set the alpha to 0.6 to both frames...


My code at the bottom of lua file

Lua Code:
  1. self.Range = cfg.frames.range

Any way to modify it?


Have also attached a range lua file from oUF
  Reply With Quote
04-29-18, 05:24 AM   #2
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Range only works based on the player frame, that is, you cannot check range between other frames. WoW API doesn't support it.
It would lead to abuse.
__________________
My oUF Layout: oUF Lumen
  Reply With Quote
04-29-18, 05:38 AM   #3
GreyFox777
A Cliff Giant
Join Date: Jan 2017
Posts: 75
But strange, because i have worked WeakAuras that does it. So it possible, im sure.
  Reply With Quote
04-29-18, 05:56 AM   #4
GreyFox777
A Cliff Giant
Join Date: Jan 2017
Posts: 75
or is there a way to set the parent on party frame but, with ability to correct the frame strata?


I tried parent and it work well, but frame strata goes crazy then...
  Reply With Quote
04-29-18, 06:40 AM   #5
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
I might be wrong then.
Thought it was only possible to check ranged between the player frame.
Someone can correct me if that is not the case.
__________________
My oUF Layout: oUF Lumen
  Reply With Quote
04-29-18, 08:53 AM   #6
GreyFox777
A Cliff Giant
Join Date: Jan 2017
Posts: 75
i think you right and oUF range doesen't work with ***target frames... Sadly.


But maybe is there a way to set alpha to a frame if another frame setted to alpha and copy this value?



I tried with

frame_4:SetAlpha(Texture2:GetEffectiveAlpha())
but that doesen't work with any changed alpha in game.

Last edited by GreyFox777 : 04-29-18 at 09:13 AM.
  Reply With Quote
04-29-18, 09:17 AM   #7
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Originally Posted by GreyFox777 View Post
i think you right and oUF range doesen't work with ***target frames... Sadly.


But maybe is there a way to set alpha to a frame if another frame setted to alpha and copy this value?



I tried with



but that doesen't work with any changed alpha in game.
Don't think that will work, there is no Event attached to it. It will always read the same value.
__________________
My oUF Layout: oUF Lumen
  Reply With Quote
04-29-18, 09:29 AM   #8
GreyFox777
A Cliff Giant
Join Date: Jan 2017
Posts: 75
But is there no way for douing that?!

All my party target frame are not affected by alpha

Seems a little not good

Last edited by GreyFox777 : 04-29-18 at 09:32 AM.
  Reply With Quote
05-01-18, 07:04 PM   #9
GreyFox777
A Cliff Giant
Join Date: Jan 2017
Posts: 75
I did it myself by setting parent.

Thread can be deleted.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Range check

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