.visibleAuras
From what I can gather from ouF aura.lua, .visibleAuras gives me the current number of Auras (Buffs + Debuffs) visible, is that right?
I'm trying to get its value on my custom PostUpdateIcon function, but everytime I call it, it returns an error. For example this in my PostUpdateIcon Code:
i = Auras.visibleAuras Interface\AddOns\oUF_lumen\oUF_lumen.lua:630: attempt to perform arithmetic on local 'i' (a nil value) Am I getting it wrong? Shouldn't it return an arithmetic value? I think .visibleAuras is a global on oUF right? So I don't need to declare it. I've search for other ouF authors layouts but rarely anyone makes use of this. Thanks! |
.visibleAuras is the value you set as a max number of auras shown.
It doesnt return you anything than the value you've set yourself. |
Quote:
Update code for .Auras element (oUF/elements/aura.lua): Code:
auras.visibleBuffs = filterIcons(unit, auras, auras.buffFilter or auras.filter or 'HELPFUL', numBuffs, nil, 0, true) Code:
buffs.visibleBuffs = filterIcons(unit, buffs, buffs.filter or 'HELPFUL', numBuffs) |
Quote:
You set i to some value (and yes, it should be set and an arithmetic) and then you declare i as local. I'm not quite sure, what Lua and WoW will make out of this, but you should try something like this: Code:
local i = Auras.visibleAuras |
Like p3lim said visibleAuras is just the maximum visible - something you set - not the amount visible. What are you looking to do, needing to know how many visible auras you have?
|
Quote:
|
Quote:
This is what I have to create my Auras (and it's working): Code:
-- Auras When I return Auras.visibleDebuffs to a local variable and try to access it it says gives the error I've displayed above. When I get back home, I'll put my latest revision code in googlecode so I can show it here. It should be simple, I just don't get it why It doesn't work. I want to know how many auras I've up so I can do a cycle to go through all the auras that are active. |
If you're using a PostUpdateIcon(), Auras is simply not visible inside of the function. Auras is not global, as far as I can tell.
Protoype is icons:PostUpdateIcon(unit, icon, index, offset), so perhaps you can go with self.Auras.visibleAuras ? |
Oh, I didn't notice you were using .PostUpdateIcon. That fires every time a single aura gets shown, before the total visible count is even known.
If you want to update the element once per aura refilter, you should use plain .PostUpdate. |
Ok. Going to try both of that when I get home by sunday. Thanks a lot. I'll report my findings! :)
PS - This WoWInterface people rocks! Thx! ^^ EDIT - Mischback, the code I've put here with local i = i + i it's wrong yes it makes no sense, that is not actually what I had in my code was just to illustrate the type of error I was having. I was getting an error from trying to set a local i = Auras.visibleAuras, then I was trying to print it to the Default Chat Frame to see what I was getting out of it, but was getting into the error I've linked in the start. Once I get back to this I will report what I found. The idea behind this would be to have an easy way to know how many auras I had up at currently. |
I achieved what I wanted in a different way, so forget about this. :]
|
All times are GMT -6. The time now is 03:58 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI