Thread Tools Display Modes
02-19-10, 06:37 PM   #1
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Combo Points Conditional Formating

Hey guys! First of all let me thanks Haste and all the developers of oUF Layouts. I've been messing with my oUF Layout, I'm using oUF_Hypocrisy, but I've been changing it so much over time that it doesn't resemble almost anything of Hypocrisy now. Tho I like how the code is organized so it's a nice framework to build my customization around it. Anyway... the question

I'm showing text for the Combo Points. It's working alright. I've searched the old oUF Topic and I've only found reference to Combo Points of a question from Roth, but it had nothing to do with this. So here I am.

Like I was saying I'm displaying the Combo Points with the code bellow. It's working alright, but the colored part is what I want to work but it isn't. I want to display the Combo Points RED if I have 5 CP's on the target. Thing is the text is always in White. I guess it has something to do with the updates or something...


Code:
if unit=="target" then
			if(playerClass=="ROGUE" or playerClass=="DRUID") then
				self.CPoints = self:CreateFontString(nil, 'OVERLAY')
				self.CPoints:SetFont(font, fontsize*3, "OUTLINE")
				self.CPoints:SetPoint('CENTER', self, 'LEFT', -110, 0)	
				self.CPoints:SetShadowOffset(1, -1)
				self.CPoints:SetJustifyH('CENTER')
				
				local ccp = GetComboPoints("target")		
				if ccp == 5 then
					self.CPoints:SetTextColor(1, 0, 0)
				else
					self.CPoints:SetTextColor(0.90, 1, 1)
				end
			end
		end
Hope some of you can help me. Thanks

-greven
  Reply With Quote
02-19-10, 08:12 PM   #2
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 122
At the time of the layout being put in place, the combo points will always be zero. Strip out the yellow part and register the combo point update event (can't remember it right now) pointing to a function that changes the text color.
  Reply With Quote
02-19-10, 10:58 PM   #3
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Oh I see... I imagined it had to do with the update of the combo points. Going to try to achieve that then... even If I'll have to do some try and error.
  Reply With Quote
02-20-10, 03:19 AM   #4
Freebaser
A Molten Kobold Bandit
 
Freebaser's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 135
Code:
local function updateCombo(self)
     do stuff..
end
...

-- this goes in the layout function
self:RegisterEvent('UNIT_COMBO_POINTS', updateCombo)
  Reply With Quote
02-20-10, 06:32 AM   #5
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Originally Posted by Freebaser View Post
Code:
local function updateCombo(self)
     do stuff..
end
...

-- this goes in the layout function
self:RegisterEvent('UNIT_COMBO_POINTS', updateCombo)
Thanks Freebaser, helpful, I had almost that already , just need to find a way to update the text inside the function since I can't link there the CPoints frame because of scope I guess.
  Reply With Quote
02-20-10, 06:10 PM   #6
Waverian
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 188
The first argument of any custom event for oUF is a reference to the frame triggering it.

Code:
local function UpdateComboPoints(self, event, unit)
     --zzz
end
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Combo Points Conditional Formating


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