Thread Tools Display Modes
12-07-10, 06:03 PM   #1
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
Player targeting Party unit check

I'm trying to create a check to check if me (as a healer) is targeting one in the party and if so highlight that frame so I know which one I'm targeting without looking out my target frame.

I have no idea where to start doing this.

Also. If I have show self in party set to true and I have a check for hp deficit for partymembers 1 through 4, how do I check myself? Currently I'm just doing a test for if min~=max and (unit=='party1' etc to 4)
Using 5 won't work.
__________________

  Reply With Quote
12-07-10, 08:26 PM   #2
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Originally Posted by sacrife View Post
... and I have a check for hp deficit for partymembers 1 through 4, how do I check myself? Currently I'm just doing a test for if min~=max and (unit=='party1' etc to 4)
Using 5 won't work.
woot? some code would help.

As for the selected unit highlighting, take a look at Freebgrid.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
12-07-10, 11:48 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by sacrife View Post
I'm trying to create a check to check if me (as a healer) is targeting one in the party and if so highlight that frame so I know which one I'm targeting without looking out my target frame.
You'd need to register for the PLAYER_TARGET_CHANGED event, and check each frame's unit when it fired:

Code:
local HighlightTarget = function(self)
     if UnitIsUnit(target, self.unit) then
          -- show the highlight on this frame
     else
          -- hide the highlight on this frame
     end
end
Then, in your spawn function:

Code:
self:RegisterEvent("PLAYER_TARGET_CHANGED", HighlightTarget)
table.insert(self.__elements, HighlightTarget)
If you want to create a special texture or something to show, do it in the same place.

Originally Posted by sacrife View Post
If I have show self in party set to true and I have a check for hp deficit for partymembers 1 through 4, how do I check myself? Currently I'm just doing a test for if min~=max and (unit=='party1' etc to 4)
Using 5 won't work.
The unit on the "player frame in party" is just player. In order to distinguish between it and the "normal" player frame, you'll need to check something else. For example, you could check if the frame's parent is your party group header. Or, if your party frames are a different size than your player frame, check that.
  Reply With Quote
12-08-10, 07:14 AM   #4
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
http://www.wowinterface.com/forums/s...ad.php?t=36870
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Player targeting Party unit check


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