Thread Tools Display Modes
06-08-10, 03:06 PM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
oUF Tags

I just came back and wanted to try the latest oUF. But since December sth. in the tag system has changed or sth. At least this is giving me errors.
Code:
  oUF.Tags["[d3o2abshp]"] = function(unit) 
    local v = UnitHealth(unit)
    local string = ""
    if UnitIsDeadOrGhost(unit) == 1 then
      string = "dead"
    elseif UnitIsConnected(unit) == nil then
      string = "off"
    else
      string = do_format(v)
    end  
    return string
  end
  oUF.TagEvents["[d3o2abshp]"] = "UNIT_HEALTH"

Call
Code:
local targetframe_health_tag = "[d3o2abshp] / [perhp]%"
    local hpval = SetFontString(self.Health, d3font, 14, "THINOUTLINE")
    hpval:SetPoint("RIGHT", self.Health, "RIGHT", -2, 2)
    self:Tag(hpval, targetframe_health_tag)
Error


What do I need to change to make it work, I checked oUF.Tag function from other layouts and they seem to be the same as mine. No clue?
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 06-08-10 at 03:24 PM.
  Reply With Quote
06-08-10, 04:00 PM   #2
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
The only time I get that error is when I define a tag after the spawning of unitframe.
You sure your tags are loading before?
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
06-08-10, 04:41 PM   #3
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Well they get defined in the code before I spawn any unit, so yes I think so.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
06-08-10, 05:46 PM   #4
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
If you are using the bleeding edge oUF from Haste's GitHub repository, then how you define tags has slightly changed.

You no longer add the square braces within the tag name when you define it, but you still need them when assigning a tag to a fontstring.


I've updated my own unit frames to be compatible with the changes made to oUF, so you can check out the tags are used there :
http://github.com/Evilpaul/oUF_EP/



Also remembered this post by Haste detailing some of the changes in how tags are used:
http://www.wowinterface.com/forums/s...1&postcount=24

Last edited by yj589794 : 06-08-10 at 06:05 PM.
  Reply With Quote
06-09-10, 01:36 AM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Thanks, that seems reasonable. And yes I was using the github oUF master. The ComboPoint stuff seems to have changed aswell.

You are using
Code:
if showCombo then
  local cpoints = self:CreateFontString(nil, 'OVERLAY')
  cpoints:SetPoint('RIGHT', self, 'LEFT', -config.SPACING, 0)
  cpoints:SetFont(config.FONT, config.FONTSIZELARGE, config.FONTBORDER)
  cpoints:SetJustifyH('RIGHT')
  self:Tag(cpoints, '|cffffffff[cpoints]|r')
end
So I guess there is a CPoints Tag now. Gonna try it out.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 06-09-10 at 01:40 AM.
  Reply With Quote
06-09-10, 01:54 AM   #6
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Yeah, for a text representation of combo points there is a new tag. The combo points module is now only for displaying an increasing number of icons based on how many combo points you have.
  Reply With Quote
06-09-10, 02:28 AM   #7
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You might want to note that the tag functions are given their own little proxy environment in 1.4. So I would recommend writing _TAGS.perhp and not oUF.Tags.perhp.

I have also renamed _CLASS_COLORS to just _COLORS, as it now exposes self.colors and not just self.colors.class.

I also plan on making some minor optimizations to tags, mainly making iteratorless functions for font strings containing only 1 to 3 tags. I haven't done any benchmarking of minor gains yet however.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
06-09-10, 03:50 AM   #8
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
If you hand out examples on how to include your ideas no problem. Whatever floats your boat. (Damn I love BBT btw...)
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
06-09-10, 04:00 AM   #9
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
elements/tags.lua is built around the same restrictions that are imposed on external tags (unlike how it was in 1.3). It should serve as a decent example of how things should be written.

I'd love to write some proper docs on the wiki, but right now I barely have time to answer stuff on the forums here. The only reason I'm even posting so far this week is because I squeeze it in between other stuff while at work.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
06-09-10, 06:27 AM   #10
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
I don't know if this is revelant but when i tried oUF 1.4 last day, i got errors similar.
The bracket around the name of the tag was the source of the error in the declaration :
i thought i was doing it wrong so i change
oUF.Tags["[sthg]"] to oUF.Tags["sthg"] and no more errors.
  Reply With Quote
06-09-10, 06:57 AM   #11
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Rostok View Post
I don't know if this is revelant but when i tried oUF 1.4 last day, i got errors similar.
The bracket around the name of the tag was the source of the error in the declaration :
i thought i was doing it wrong so i change
oUF.Tags["[sthg]"] to oUF.Tags["sthg"] and no more errors.
Yes, the brackets were removed from the table keys in 1.4. It was really something which was suppose to be done before a release with tags were made, but that was forgotten :P.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
06-09-10, 10:59 AM   #12
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
Ok, I got it working so it's cool. Maybe zork's tags are also concerned by this change as they have the brackets.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF Tags


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