Thread Tools Display Modes
01-04-11, 06:44 AM   #1
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
Help with toggle showing LFD Role icons

I managed to show/hide LFD icons using OnEnter and OnLeave scripts but i'm getting artifacts in place of the role icon if no role has been defined to that unit.

What I need is a way to determine if the unit has been asigned a role in order to show (or not) the icon, but I don't think OnEnter passes anything else but the frame so I can't use UnitGroupRolesAssigned().
  Reply With Quote
01-04-11, 10:20 AM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You could just use :SetAlpha() instead. Unless you are planning on doing more magic as well, but based on your description it sounds like the most pleasant solution.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
01-04-11, 10:40 AM   #3
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
Of course! The show/hide is correctly handled already, I just need to use SetAlpha, just like I did with XP and Rep bars (which, by the way, still driving me mad because of that haunted tags).

ON TOPIC:
How can I check if a key is being pressed? I want to know if it's possible to only show role icons when I mouseover my raid units while holding down the CTRL key.
  Reply With Quote
01-04-11, 10:53 AM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by drakull View Post
How can I check if a key is being pressed? I want to know if it's possible to only show role icons when I mouseover my raid units while holding down the CTRL key.
http://wowprogramming.com/docs/api/IsControlKeyDown
__________________
「貴方は1人じゃないよ」
  Reply With Quote
01-04-11, 03:59 PM   #5
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
How easy is that?

Thanks!
  Reply With Quote
01-09-11, 03:13 PM   #6
barbol12
A Cyclonian
 
barbol12's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 42
Originally Posted by drakull View Post
I managed to show/hide LFD icons using OnEnter and OnLeave scripts but i'm getting artifacts in place of the role icon if no role has been defined to that unit.

What I need is a way to determine if the unit has been asigned a role in order to show (or not) the icon, but I don't think OnEnter passes anything else but the frame so I can't use UnitGroupRolesAssigned().
you could try something like this...

lua Code:
  1. local createLFDRole = function(self)
  2.     self.LFDRole = self.Health:CreateTexture(nil, "OVERLAY")
  3.     self.LFDRole:SetTexture("Interface\LFGFrame\UI-LFG-ICON-PORTRAITROLES")
  4.     self.LFDRole:SetSize(12, 12)
  5. end

and then, wherever u are setting the role icons, for ur party/raid.... put something like this..

lua Code:
  1. createLFDRole(self)
  2.        self.LFDRole:SetPoint("TOPRIGHT", self.Health,'TOPRIGHT', 0, 0)

this is my coding i use for my oUF for showing role icons on the party members... basically putting the top part, somewhere at beginning, with ur tags or whatever... then putting the second part within the party frame coding, itself.

hope this helps.....
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Help with toggle showing LFD Role icons

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