Thread Tools Display Modes
Prev Previous Post   Next Post Next
07-26-16, 07:17 PM   #1
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Quick question about oUF Tag

I was trying to create a Name text which colors name with raidcolor while level is not and here's how I've done it.

Lua Code:
  1. A.CreateNameText = function(f, unit)
  2.     local Name = f.Health:CreateFontString("$parentName", "OVERLAY");
  3.     Name:SetFont(NAME_FONT, 12, "OUTLINE");
  4.  
  5.     if unit == "player" then
  6.         Name:SetPoint("BOTTOMLEFT", f.Health, "TOPLEFT", 0, 2);
  7.  
  8.         f:Tag(Name, "[level] [raidcolor][name]|r");
  9.     elseif unit == "target" then
  10.         Name:SetPoint("BOTTOMRIGHT", f.Health, "TOPRIGHT", 0, 2);
  11.  
  12.         f:Tag(Name, "[raidcolor][name]|r [level][plus]");
  13.     elseif unit == "targettarget" then
  14.         Name:SetPoint("CENTER", f.Health, "CENTER");
  15.  
  16.         f:Tag(Name, "[raidcolor][name]|r");
  17.     end
  18. end

I have added |r at the end of [name] tag in order to prevent the next texts being effected by [raidcolor] tag.

This seems to be working, but I am not sure whether there is another possible built in solution for this within oUF.
(I had a look at Tag.lua file and failed to find something that is related to this... )

Last edited by Layback_ : 07-26-16 at 07:21 PM.
  Reply With Quote
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Quick question about oUF Tag


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