Thread Tools Display Modes
07-06-09, 08:51 PM   #1
tarolaide
A Kobold Labourer
Join Date: Jul 2009
Posts: 1
Question n00b updating text question

Hi,

I've been messing around with oUF, trying to make my own layout. Been looking at, ripping off, and generally learning from a few other layouts, but I can't seem to figure out a problem I've run into with updating texts.

First up is status text like DND and AFK:

Code:
oUF.TagEvents['[DNDAFK]'] = 'PLAYER_FLAGS_CHANGED'

self.Info = SetFontString(self.Power, font, (unit == "target" or unit == "player") and 11 or 9)
self.Info:SetPoint("LEFT", 2, 0)
self:Tag(self.Info, "[AFKDND][SName]")
My targettarget frame updates the status fairly quickly (within 1 sec), but my target frame only updates when I re-target. And my player frame doesn't update at all unless I do a console reload. I'm probably not doing something event-wise I should be doing, but I have no idea what.


Next problem: When someone joins the party, my race text code throws out an error saying something about a nil value. I'm guessing it's trying to get the information before the unit is actually there? Where it's supposed to say this info in the status bar is blank instead until I do a console reload.

Code:
oUF.Tags["[SmartRace]"] = function(unit)
	if unit then return (UnitIsPlayer(unit) and UnitRace(unit) .." "..UnitClass(unit)) or UnitCreatureFamily(unit) or UnitCreatureType(unit) end
end

self.Race = SetFontString(self.Health, font, (unit == "target" or unit == "player") and 11 or 9)
	self.Race:SetPoint("TOPLEFT", 2, (unit == "targettarget" or unit == "pettarget" or unit == "focustarget") and -3 or -4)
	self:Tag(self.Race, (unit == "targettarget" or unit == "focustarget" or unit == "pettarget" or unit == "focus" or unit == "pet") and "[DiffColor][SmartLevel]|r" or "[DiffColor][SmartLevel]|r [SmartRace]")

Thanks for any input!
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » n00b updating text question


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