Thread Tools Display Modes
10-14-10, 07:29 PM   #1
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
LFD Icons/bars not working after 1.5x

This used to work fine, now it won't. What's changed?

Code:
	local lfdrole = CreateFrame("StatusBar", nil, self)
	lfdrole:SetStatusBarTexture(sett1ngs.texture)
	lfdrole:SetFrameStrata("MEDIUM")
	lfdrole:SetFrameLevel(4)
	lfdrole:SetHeight(sett1ngs.cicon)
	lfdrole:SetWidth(sett1ngs.cicon)
	lfdrole:SetPoint("BOTTOMLEFT", -1, -4)
	lfdrole:SetStatusBarColor(1, 1, 1)
	lfdrole.bd = SetBD(lfdrole, backdrop, {0,0,0,1}, "MEDIUM")

	lfdrole.Update = function(self, event)
		local role = self.LFDRole
		local isTank, isHealer, isDamage = UnitGroupRolesAssigned(self.unit) 

		if isTank then 
			role:SetStatusBarColor(0, .7, 1)
			role:Show()
		elseif isHealer then 
			role:SetStatusBarColor(0, 1, 0) 
			role:Show()
		elseif isDamage then 
			role:SetStatusBarColor(1, 0, 0)
			role:Show()
		else
			role:Hide()
		end
	end

	self.LFDRole = lfdrole
__________________

  Reply With Quote
10-14-10, 07:45 PM   #2
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
I have a tag for LFD Roles to output text instead of Icons and it's not working too. It's showing everyone as tanks when in a party.

Code:
	-- LFGRole
	oUF.Tags["lumen:lfdrole"] = function(unit)
	
		local isTank, isHealer, isDamage = UnitGroupRolesAssigned(unit)

		if(isTank) then
			return 'Tank'
		elseif(isHealer) then
			return 'Healer'
		elseif(isDamage) then
			return 'Damage'
		else
			return ''
		end
	end
	
	oUF.TagEvents["lumen:lfdrole"] = "PARTY_MEMBERS_CHANGED PLAYER_ROLES_ASSIGNED"
__________________
My oUF Layout: oUF Lumen
  Reply With Quote
10-14-10, 09:36 PM   #3
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 363
This works for me:
lua Code:
  1. if unit == "player" or unit == "party" then
  2.     self.LFDRole = self.overlay:CreateTexture(nil, "OVERLAY")
  3.     self.LFDRole:SetPoint("RIGHT", self.Portrait, "RIGHT", 7, 0)
  4.     self.LFDRole:SetSize(20, 20)
  5. end
  Reply With Quote
10-14-10, 10:43 PM   #4
Freebaser
A Molten Kobold Bandit
 
Freebaser's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 135
Originally Posted by sacrife View Post
This used to work fine, now it won't. What's changed?
element.Override instead of element.Update
  Reply With Quote
10-15-10, 02:07 AM   #5
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Also the Blizzard API has slightly changed...

Previous:
Code:
isTank, isHeal, isDPS = UnitGroupRolesAssigned(Unit)
New:
Code:
role = UnitGroupRolesAssigned(Unit)
the return value role is of type string, with possible values of "NONE", "TANK", "HEALER", "DAMAGER".
  Reply With Quote
10-15-10, 02:15 AM   #6
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 363
Originally Posted by yj589794 View Post
the return value role is of type string, with possible values of "NONE", "TANK", "HEALER", "DAMAGER".
Is Blizzard allowing us to sort party/raid headers with these roles now?
  Reply With Quote
10-15-10, 02:18 AM   #7
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Originally Posted by ForeverTheGM View Post
Is Blizzard allowing us to sort party/raid headers with these roles now?
I have no idea.
  Reply With Quote
10-15-10, 05:59 AM   #8
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Originally Posted by yj589794 View Post
Also the Blizzard API has slightly changed...

Previous:
Code:
isTank, isHeal, isDPS = UnitGroupRolesAssigned(Unit)
New:
Code:
role = UnitGroupRolesAssigned(Unit)
the return value role is of type string, with possible values of "NONE", "TANK", "HEALER", "DAMAGER".
Awesome, didn't see it returns the actual role now, my Tag works now. :]

Thanks a lot.
__________________
My oUF Layout: oUF Lumen
  Reply With Quote
10-15-10, 08:07 AM   #9
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
Just to clarify, does it return "DAMAGE" or "DAMAGER" because it looks like a typo
__________________

  Reply With Quote
10-15-10, 08:14 AM   #10
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
It returns "DAMAGER", as in someone who does damage. It's an awful word, which I why I prefer displaying the related icon rather than the returned text.
  Reply With Quote
10-15-10, 08:16 AM   #11
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
And that is why I want to create small squares instead of both text and the ugly icons :P
__________________

  Reply With Quote
10-15-10, 11:05 AM   #12
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
Code:
	local lfdrole = CreateFrame("StatusBar", nil, self)
	lfdrole:SetStatusBarTexture(sett1ngs.texture)
	lfdrole:SetFrameStrata("MEDIUM")
	lfdrole:SetFrameLevel(4)
	lfdrole:SetHeight(sett1ngs.cicon)
	lfdrole:SetWidth(sett1ngs.cicon)
	lfdrole:SetPoint("BOTTOMLEFT", -1, -4)
	lfdrole:SetStatusBarColor(1, 1, 1)
	lfdrole.bd = SetBD(lfdrole, backdrop, {0,0,0,1}, "MEDIUM")

	lfdrole.Override = function(self, event)
		local role = self.LFDRole
		local roles = UnitGroupRolesAssigned(Unit)

		if roles == 'TANK' then 
			role:SetStatusBarColor(0, .7, 1)
			role:Show()
		elseif roles == 'HEALER' then 
			role:SetStatusBarColor(0, 1, 0) 
			role:Show()
		elseif roles == 'DAMAGER' then 
			role:SetStatusBarColor(1, 0, 0)
			role:Show()
		else
			role:Hide()
		end
	end

	self.LFDRole = lfdrole
should work.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » LFD Icons/bars not working after 1.5x


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