Thread Tools Display Modes
05-04-10, 04:05 PM   #1
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
pp tag not updating for focus, but focustarget fine?

Hai ...

For some obscure reason --
My Focus' power tag doesn't seem to update as it should. It seems to not see depletion or replenishment until I cast an HP changing buff. (Heals have no effect). The powerbar (when enabled) shows up fine. Did I make an oopsie?

Funny note : The code is the same as Focustarget, which does work fine.

(Player, Target, ToT, FocusTarget, Pet all work fine.)

Code:
elseif unit == "focus" or unit == "focustarget" then
		self.Name = SetFontString(self.Health, font, fontSize+1, "LEFT", self.Health, "LEFT", 2, 0)
		self:Tag(self.Name, "[raidcolor][shortname] [dead]")
		
		self.Health.value = SetFontString(self.Health, font, fontSize+1, "RIGHT", self.Health, "RIGHT", -2, 0)
		self:Tag(self.Health.value, "[colorperpp]%|r | [perhp]%")
ANd the tags themselves -- credit to P3lim btw
Code:
oUF.Tags["[colorperpp]"] = function(unit)
	local _, str = UnitPowerType(unit)
	return ('%s%d'):format(hex(colors.power[str] or {1, 1, 1}), oUF.Tags['[perpp]'](unit) or '')
end
  Reply With Quote
05-04-10, 11:42 PM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Are you assigning any events to your tag?

You should also move that table outside the tag function.
It should also return nothing (nil) and not '' when it fails, which means you can't use the logic short cut.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
05-05-10, 12:09 PM   #3
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
Uhm .... I copied from, p3lim and ...

Code:
oUF.Tags["[colorpp]"] = function(unit) -- from p3lim"s excellently coded layout
	local _, str = UnitPowerType(unit)
	return ('%s%d|r'):format(hex(colors.power[str] or {1, 1, 1}), oUF.Tags['[curpp]'](unit) or '')
end

oUF.Tags["[colorperpp]"] = function(unit)
	local _, str = UnitPowerType(unit)
	return ('%s%d'):format(hex(colors.power[str] or {1, 1, 1}), oUF.Tags['[perpp]'](unit) or '')
Those work fine. Also, focustarget uses the exact same code, and works fine.
  Reply With Quote
05-05-10, 02:33 PM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by MoonWitch View Post
Those work fine. Also, focustarget uses the exact same code, and works fine.
focustarget isn't a real unit, and has a completely different update path.
Code:
oUF.TagEvents["[colorpp]"] = oUF.TagEvents["[curpp]"]
Alternatively you could have [colorpp] just return the color and use [curpp] manually after it, which would make it piggyback ride on the [curpp] events.

Oh, and generic names are bad (even though the 1.3.x tag system kinda enforces them).
__________________
「貴方は1人じゃないよ」
  Reply With Quote
05-05-10, 08:57 PM   #5
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
Well, the update difference would explain it. I thought all units followed the same update method/timing.

Focustarget was always something iffy to me, but since I've been healing ICC it's handy :P As a disc priest, I gotta prep for incoming dmg, if I see anyone but the tanks targetted, I'll bubble em ahead of dmg

Anyhow :
I'll try it how you said it and change all tags to a line-up how you suggested.

Code:
oUF.Tags["[colorpp]"] = function(unit)
	local _, str = UnitPowerType(unit)
	local coloredmana = colors.power[str]
	return coloredmana and string.format("|cff%02x%02x%02x", coloredmana[1] * 255, coloredmana[2] * 255, coloredmana[3] * 255)
end
I'm assuming this is how you meant it? Can't recall where I got this, it's in an older layout of mine to resemble Caith's UI

Update :
Well, with the changes you proposed it worked!!! Thanks

Last edited by MoonWitch : 05-05-10 at 09:31 PM. Reason: update
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » pp tag not updating for focus, but focustarget fine?


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