View Single Post
03-31-14, 12:42 PM   #29
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Originally Posted by Clamsoda View Post
I mean....it doesn't necessarily pertain to anything in particular, it is just applied API. Technically, you could pass any name token through it as long as there aren't any "-" outside of the delimitation. If there is no realm name, you just get a name; if there is a realm name, you get the "(*)".

The one issue I see is the inconsistency in how name-realm tokens are passed through certain functions and events at the moment. "(*)" has typically been used for units on other realms, but some events -- CLEU for example -- are passing names with realms attached regardless of if they are on your realm or not.

Tl;dr: You may get "(*)" for units that are on your realm as well, giving the false impression that they are cross-realm.

Of course, you could cache your realm and match it against what got split and go from there.
Ok so something like:
Lua Code:
  1. if db.unitframes.party.enable then
  2.         for i = 1, MAX_PARTY_MEMBERS do
  3.             local partyFrame = "PartyMemberFrame"..i
  4.             local originalName = _G[partyFrame].name
  5.             local unitName, unitRealm = strsplit("-", originalName)
  6.             _G[partyFrame].name:SetText(unitRealm and unitName.."(*)" or unitName)         
  7.             _G[partyFrame]:SetScale(db.unitframes.party.scale);
  8.             _G[partyFrame.."HealthBarText"]:SetFont(db.fontNormal, db.unitframes.party.fontSize, "THINOUTLINE");
  9.             _G[partyFrame.."ManaBarText"]:SetFont(db.fontNormal, db.unitframes.party.fontSize, "THINOUTLINE");
  10.     end

Should set the name of my party members to just there name?
  Reply With Quote