Will PB4 be implementing a group for the boss frames that were introduced in ~3.3? For example the ones that pop up in add intensive fights or where the health you're interested in is non-standard (gunship).
Thanks for a brilliant addon, this is a thoroughly fantastic job! And specifically, thanks for the Flask of the North support, I didn't think that this would happen but really appreciate having a reminder for it! It doesn't seem to work with the ZOMGSelfBuff templates however, would that be easy to achieve?
There's a button whose bgFile is set to a spell's texture (i.e. square with slightly rounded edges) and I'd like very much for it to be rounded. I have a .tga I expected to do this for me (it's basically a circle with an alpha:0 background) but when I :CreateTexture, :SetTexture etc I just get a small round blob inside the button with the button's icon still showing outside the blob (which should have alpha =0). I've tried the different blend modes but not much fundamental changes. The code's here: http://paste.wowace.com/864/
I'd like to know about all the bindings currently bound. I've hit a problem though, code like:
local binds = {}
for i=1, GetNumBindings() do
local command = GetBinding(i)
local bindings = {GetBindingKey(command)}
binds[command] = bindings
end
results in binds only containing the bindings from Bindings.xml or the Blizzard controls, "MOVEFORWARD" etc. Is it not possible to iterate over bindings for directly bounds SPELLs, MACROs, ITEMs and CLICKs?
Thanks! I did do a few searches but always for dictionaries, not tables so I missed that. next(t) is the answer for my immediate problem of 'if not empty then'.
Quote from Slakah »
Until then you could muck about with newproxy for the time being.
For dictionary tables (non-integer keys) I'd very much like to get the length simply with a #table op (partly because it's quicker to type and easier to read but mostly because I'd like to explore metatables some).
Reading the manual leads me to conclude that this is impossible unless there's some way of overriding the __len method in a table's metatable that I'm missing.
The manual says that it runs a function like this when a length op is requested:
function len_event (op)
if type(op) == "string" then
return strlen(op) -- primitive string length
elseif type(op) == "table" then
return #op -- primitive table length
else
local h = metatable(op).__len
if h then
-- call the handler with the operand
return (h(op))
else -- no handler available: default behavior
error(ยทยทยท)
end
end
end
Which suggests that Lua never bothers to check a table's metatable for the __len function if its type == table.
Does anyone know how to do this or has a definitive answer as to whether it's possible?
Aaah of course, I assumed that NotifyChange just refreshed values because the function didn't have any parameter giving a new table but because it's a reference from RegisterOptionsTable any changes will be reflected. Silly me, the problem was also the solution!
I'm trying to tighten up my addon's code. I am using AceConfig and options tables to do all my addon's configuration. I have a couple of questions regarding how best to implement dynamically changing options tables that include some constant and presumably reusable elements.
Currently my code structure looks a bit like this (in no official form of pseudo code, sorry):
OnLoad: RegisterOptions()
OnChange: RegisterOptions()
RegisterOptions()
opts = {
constantOpt = blah,
anotherConstantOpt = blahtoo,
}
do loop on someSavedVariables
opts.dynamicVariable = blah2
opts.dynamicVariable = blah2too
end loop
AceConfig:RegisterOptionsTable(opts)
end
Firstly, is there a better way of refreshing my configuration screen when something updates (mainly new group elements are added)? I looked at NotifyChange() but that seems to just force a refresh of values rather than applying structural changes to the options table (which is what my dynamic changes do).
Secondly, I worry that I'm creating many new table references every time I need to change the structure of my options table which I don't particularly like, but perhaps this is OK? The two solutions I can think of would be to move the constant parts out of the RegisterOptions function and either include them in the opts inside the RegisterOptions function (which would result in doubling up the options every time because all table assignments are references) or by copying it and then including it in the opts (which seems just as wasteful). It gets even more silly as a lot of the dynamic parts are just loops which include mostly constant tables with a few modifications based on iteration of the loop.
If the question is still unclear (I don't blame you) the offending code is in SVN at svn://svn.curseforge.net/wow/settheory/mainline/trunk and known as opts.lua
I did not expect such a library to be a massive memory saver but more an author time saver by providing a logical and quick way of expressing combinations of events and by offering to automatically generate a configuation UI for user-customisable triggers. Several addons I use implement this kind of functionality and all of them have one or two draw-backs such as not being able to combine triggers or being limited by their quantity or completeness.
Either way, I'll implement what I have in mind for my own purposes and if I think it's worth sharing I'll try to do so.
0
Thanks for a great addon,
Dan.
EDIT: It's already discussed here: http://www.wowace.com/addons/pitbull4/tickets/623-frames-for-boss1-boss4-unit-ids-in-patch-3-3-0/
0
Good to know, thanks.
0
Out of curiosity, how does he get it?
Dan.
0
Does anyone know if the Blizzard interface will be up on wowcompares at any point? Or is there a way of extracting it ourselves?
Thanks,
Dan.
0
EDIT: Discovered it can't: see Blizzard's SecureTemplates.lua.
0
Thanks for a brilliant addon, this is a thoroughly fantastic job! And specifically, thanks for the Flask of the North support, I didn't think that this would happen but really appreciate having a reminder for it! It doesn't seem to work with the ZOMGSelfBuff templates however, would that be easy to achieve?
Thanks,
Dan.
0
There's a button whose bgFile is set to a spell's texture (i.e. square with slightly rounded edges) and I'd like very much for it to be rounded. I have a .tga I expected to do this for me (it's basically a circle with an alpha:0 background) but when I :CreateTexture, :SetTexture etc I just get a small round blob inside the button with the button's icon still showing outside the blob (which should have alpha =0). I've tried the different blend modes but not much fundamental changes. The code's here: http://paste.wowace.com/864/
Thanks in advance for any help,
Dan.
0
I'll try it and see if it's too much of a resource sink for the benefits,
Dan.
0
I'd like to know about all the bindings currently bound. I've hit a problem though, code like:
results in binds only containing the bindings from Bindings.xml or the Blizzard controls, "MOVEFORWARD" etc. Is it not possible to iterate over bindings for directly bounds SPELLs, MACROs, ITEMs and CLICKs?
Thanks,
Dan.
0
Thanks! I did do a few searches but always for dictionaries, not tables so I missed that. next(t) is the answer for my immediate problem of 'if not empty then'.
Thanks! I'll memorise that for the future :)
Dan.
0
For dictionary tables (non-integer keys) I'd very much like to get the length simply with a #table op (partly because it's quicker to type and easier to read but mostly because I'd like to explore metatables some).
Reading the manual leads me to conclude that this is impossible unless there's some way of overriding the __len method in a table's metatable that I'm missing.
The manual says that it runs a function like this when a length op is requested:
Which suggests that Lua never bothers to check a table's metatable for the __len function if its type == table.
Does anyone know how to do this or has a definitive answer as to whether it's possible?
Thanks, Dan.
0
Thanks Xin!
Dan.
0
I'm trying to tighten up my addon's code. I am using AceConfig and options tables to do all my addon's configuration. I have a couple of questions regarding how best to implement dynamically changing options tables that include some constant and presumably reusable elements.
Currently my code structure looks a bit like this (in no official form of pseudo code, sorry):
Firstly, is there a better way of refreshing my configuration screen when something updates (mainly new group elements are added)? I looked at NotifyChange() but that seems to just force a refresh of values rather than applying structural changes to the options table (which is what my dynamic changes do).
Secondly, I worry that I'm creating many new table references every time I need to change the structure of my options table which I don't particularly like, but perhaps this is OK? The two solutions I can think of would be to move the constant parts out of the RegisterOptions function and either include them in the opts inside the RegisterOptions function (which would result in doubling up the options every time because all table assignments are references) or by copying it and then including it in the opts (which seems just as wasteful). It gets even more silly as a lot of the dynamic parts are just loops which include mostly constant tables with a few modifications based on iteration of the loop.
If the question is still unclear (I don't blame you) the offending code is in SVN at svn://svn.curseforge.net/wow/settheory/mainline/trunk and known as opts.lua
Thanks for any help you can give me,
Dan.
0
Either way, I'll implement what I have in mind for my own purposes and if I think it's worth sharing I'll try to do so.
Thanks again,
Dan.
0
Dan.