Add the part highlighted in teal:
Code:
else |
Quote:
Last question then I think I'm done with font's. My tooltip addon I use is based primarily off of nTooltip and for his pets he uses a color like: Code:
r = 157/255 How would I get the highlighted yellow code to be this color: Code:
hooksecurefunc("UnitFrame_Update", function(self) I know I couldjust change the tooltip font to: Code:
r = 1 Thanks again for all your guys help with my font questions. Coke |
Code:
local PET_COLOR = { r = 157/255, g = 197/255, b = 255/255 } |
Quote:
Now for a personal question do you do programming for a living or is this just a hobby like me? Either way you are great at it and thank you for all you do for us less then program savvy people. Coke |
Yet another font string question...
Is there a way to hide a party members realm, I've search the forums and only found this function for the chat not for the unit frames. I would really like to change "-REALNAME" to (*) if possible. Coke |
Lua Code:
What is happening here is that strsplit will pass everything before and after the defined delimiter to as many variables as we allow it to. NAME-REALM keys are always delimited by a "-", and I am almost positive that no REALM keys contain a "-", thus we can safely split the name from the realm in this way. If unitRealm becomes defined, we print unitName with "(*)" concatenated; else we print just the name. This should be quite adaptable, let me know if you need any further assistance. |
Quote:
Coke |
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. |
Quote:
Lua Code:
Should set the name of my party members to just there name? |
That looks functional to me, log into WoW and try it =~].
|
when I log in I get this error with all addons enabled:
Code:
3x BasicUI-5.4.7\Modules\Unitframes.lua:50: bad argument #2 to "strsplit" (string expected, got table) Code:
Message: Interface\AddOns\BasicUI\Modules\Unitframes.lua:50: bad argument #2 to 'strsplit' (string expected, got table) |
It's a table value. The fontstring widget itself.
Use: _G[partyFrame].name:GetText() |
Lua Code:
needs to be Lua Code:
|
2 Attachment(s)
Quote:
Below I have attached my Unitframes.lua, Phanx helped me with a code to change my Unit Text color and I think it is conflicting with this script. I get this error: Code:
Message: Interface\AddOns\BasicUI\Modules\Unitframes.lua:52: bad argument #2 to 'strsplit' (string expected, got table) Coke |
I suspect the issue is that you are iterating over every possible party unitframe, even when no unit has been assigned to it. If there is no unit, there is no name token to pass into strsplit.
What I suspect you need to do is listen to GROUP_ROSTER_UPDATE and iterate over the party frames that actually have assigned units. That is the only thing I can think of looking over your code. Hopefully someone else will take a look and offer some insight. |
It would be simpler to just ignore the original text and get the name again:
Code:
_G[partyFrame].name:SetText(GetUnitName("party"..i)) Code:
_G[partyFrame].name:SetText(GetUnitName("party"..i, true)) (a) you did not, in fact, make the change Clamsoda suggested, as your originalName variable is still referring to the fontstring, rather than its text contents, or (b) the unit in question doesn't exist. Using GetUnitName instead of manipulating the existing text will avoid this problem, but you should really not bother doing anything with frames that aren't shown. I see you're checking GetNumGroupMembers() >= 1 on each loop iteration; this is wasteful and won't achieve the desired result anyway, because having 1 party member doesn't mean you have 4 party members. Instead, just check that the frame being processed is shown: Code:
for i = 1, MAX_PARTY_MEMBERS do Code:
hooksecurefunc("UnitFrame_Update", function(self, isParty) |
All times are GMT -6. The time now is 02:40 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI