Currently LibTalentQuery-1.0 on the svn has LibStub and CallbackHandler-1.0 set as externals. This means the files are not present in the no-ext zip, and as a result the library will not load disembedded. Can you please copy these over instead of using externals so that they load correctly?
Libraries that use libraries should not embed any embedded libraries manually. If you do so, the calling addon may end up with multiple copies of Libstub and Callbackhandler if every library tat uses them embeds them manually. The addon that uses these libraries has the responsibility of knowing these dependencies and external/embedding them manually in their addon.
And then addons can embed the internal dir and get only the files they need, while the disembedded download still works properly. But nobody bothers with that.
And then addons can embed the internal dir and get only the files they need, while the disembedded download still works properly. But nobody bothers with that.
Yes, this format makes the most sense imho.
Also, if libs that don't look like this today get an extra lib.xml in the top folder they can be converted to this format without breaking addons that currently use them as externals.
Also, if libs that don't look like this today get an extra lib.xml in the top folder they can be converted to this format without breaking addons that currently use them as externals.
Make the lib.xml in bold include CBH and LibStub, and the LibWhatever-1.0/lib.xml not include them, and I <3 you all forever xxx ooo
That would encourage addon authors to be lazy and embed the outer dir, which completely defeats the purpose. The CBH and LibStub files should only be loaded by the lib's toc, since they should only be loaded by the lib when it is actually disembedded.
I copy-pasted the example-code from the wiki almost literally. But my TalentQuery_Ready call-back function simply will not run at all.
I've compared my code to LibDogTag and MoBuffs, but I simply cannot spot a (significant) difference.
What is it I'm missing? I know, you guys probably are not psychic, but this is extremely frustrating. I'm assuming the library functions correctly, as the Dogtag-talent-stuff seems to work.
Generally if you're having a problem with your code, we need to see your code in order to help you figure out what's wrong with it or what's missing. Try attaching your file to your post.
Right. In my late-night frustrations I forgot to attach the code. Here it is. PrepareAutoDetect() is called from addon:OnInitialize()
I've never seen "TalentQuery callback" printed to the screen...
"inrange and maxlevel" has shown up, of course.
--===================
-- Local variables ==
--===================
local addon = DebuffSlots
local TalentQuery = LibStub:GetLibrary("LibTalentQuery-1.0")
--====================
-- PUBLIC functions ==
--====================
function addon:PrepareAutoDetect()
TalentQuery.RegisterCallback(addon, "TalentQuery_Ready")
-- addon:PrintKeyValue(TalentQuery)
end
local MAXLEVEL = 70
local INSPECTINDEX = 1
function addon:AutoDetect(playername, unitid)
self:Print(unitid.." "..playername)
-- Level check
local maxlevel = true
if UnitLevel(unitid) == MAXLEVEL then
maxlevel = true
end
-- Range check
local inrange
if not UnitIsUnit(unitid, "player") then
if CheckInteractDistance(unitid, INSPECTINDEX) then
inrange = true
else
inrange = false
end
else
inrange = true
end
if inrange and maxlevel then
self:Print("inrange and maxlevel")
if UnitIsUnit(unitid, "player") then
self:TalentQuery_Ready(_, UnitName(unitid))
else
TalentQuery:Query(unitid)
end
elseif not maxlevel then
elseif not inrange then
end
end
local SPECTHRESHOLD = 31
function addon:TalentQuery_Ready(e, name, realm)
addon:Print("TalentQuery callback")
local namerealm = realm and realm ~= "" and name .. "-" .. realm or name
local isnotplayer = (name ~= UnitName("player"))
local preset = 0
for tab = 1, GetNumTalentTabs(isnotplayer) do
local _, iconTexture, pointsspent = GetTalentTabInfo(tab, isnotplayer)
if pointsspent >= SPECTHRESHOLD then
preset = self.MAP_TREEICON2PRESET[iconTexture]
end
end
if preset > 0 then
addon:Print(name.." has spec "..addon.PRESETS_NAMES[preset])
else
addon:Print("preset = 0")
end
end
I'm trying to use LibTalentQuery for a pet project of mine and I have difficulties making it work. Basically I've setup the callback and, on RAID_ROSTER_UPDATE, I am sending the query (TalentQuery:Query(unit)) on all units in raid for whom I don't have any information. The problem is that for a given flurry of talent queries all I ever get back is the talent information for one and only one of these units...
I've temporarily made it work by not relying on RAID_ROSTER_UPDATE but by firing my flurry of queries every second, it gets the job done but it's ugly and should not be necessary if I understand LibTalentQuery correctly...
Any idea ? Any limitations I should know about LibTalentQuery ?
I'm trying to use LibTalentQuery for a pet project of mine and I have difficulties making it work. Basically I've setup the callback and, on RAID_ROSTER_UPDATE, I am sending the query (TalentQuery:Query(unit)) on all units in raid for whom I don't have any information. The problem is that for a given flurry of talent queries all I ever get back is the talent information for one and only one of these units...
I've temporarily made it work by not relying on RAID_ROSTER_UPDATE but by firing my flurry of queries every second, it gets the job done but it's ugly and should not be necessary if I understand LibTalentQuery correctly...
Any idea ? Any limitations I should know about LibTalentQuery ?
Testing some re-hashing of the queuing code. Managed to improve the speed of talent collection from a couple of minutes to around 15 seconds for a 25 man group. Also that it won't purge it's queue if it can't read someone, but rather keep it and assume you really did want their talents.
Ok. Posted r57 just now. Can some please test it and make sure it's not going to fail for any reason. If it's working out, I'll get one of the admins to bump it to beta version.
I'm having running into an issue in my LibTalentQuery callback. When I call GetTalentTabInfo( tab, inspect ) in my callback, I occasionally get my talent info, rather than the inspect talent info.
My callback function is paraphrased below:
function MyMod.TalentQuery_Ready( event, name, realm, unitid )
local inspect = ( name ~= playerName )
local spec = {}
local totalPoints = 0
local talentTabs = GetNumTalentTabs( inspect )
for tab = 1, talentTabs do
local treeName, _, treePoints = GetTalentTabInfo( tab, inspect )
totalPoints = totalPoints + treePoints
table.insert( spec, { treeName = treeName, treePoints = treePoints } )
end
The name is that of another unit, but the talent tree info is mine.
Any ideas?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
/trunk/LibWhatever-1.0/
LibWhatever-1.0.toc
LibStub.lua
CallbackHandler-1.0.lua
LibWhatever-1.0/
lib.xml
LibWhatever-1.0.lua
<other lib files>
And then addons can embed the internal dir and get only the files they need, while the disembedded download still works properly. But nobody bothers with that.
Yes, this format makes the most sense imho.
Also, if libs that don't look like this today get an extra lib.xml in the top folder they can be converted to this format without breaking addons that currently use them as externals.
/trunk/LibWhatever-1.0/
LibWhatever-1.0.toc
LibStub.lua
lib.xml
CallbackHandler-1.0.lua
LibWhatever-1.0/
lib.xml
LibWhatever-1.0.lua
<other lib files>
Make the lib.xml in bold include CBH and LibStub, and the LibWhatever-1.0/lib.xml not include them, and I <3 you all forever xxx ooo
That would encourage addon authors to be lazy and embed the outer dir, which completely defeats the purpose. The CBH and LibStub files should only be loaded by the lib's toc, since they should only be loaded by the lib when it is actually disembedded.
TalentIconTexturePath - what is this and where can I find docs or examples on it?
So one could simply do:
local tree1, tree2, tree3 = LibTalentQuery:GetTalents("Saroz" or "raid20") returns 42,14,0
or even
local spec = LibTalentQuery:GetTalentSpec("Saroz" or "raid20") [Returns Holy]
I copy-pasted the example-code from the wiki almost literally. But my TalentQuery_Ready call-back function simply will not run at all.
I've compared my code to LibDogTag and MoBuffs, but I simply cannot spot a (significant) difference.
What is it I'm missing? I know, you guys probably are not psychic, but this is extremely frustrating. I'm assuming the library functions correctly, as the Dogtag-talent-stuff seems to work.
Greetings,
Arthic of SylvanasEU
I've never seen "TalentQuery callback" printed to the screen...
"inrange and maxlevel" has shown up, of course.
Could somebody take a look at the code I posted above and make any suggestions about what could be wrong with it? I'd really appreciate that.
Greetings,
Arthic of SylvanasEU
I've temporarily made it work by not relying on RAID_ROSTER_UPDATE but by firing my flurry of queries every second, it gets the job done but it's ugly and should not be necessary if I understand LibTalentQuery correctly...
Any idea ? Any limitations I should know about LibTalentQuery ?
Testing some re-hashing of the queuing code. Managed to improve the speed of talent collection from a couple of minutes to around 15 seconds for a 25 man group. Also that it won't purge it's queue if it can't read someone, but rather keep it and assume you really did want their talents.
The changes are:
1) declare the variable unit as local.
2) fix the return values for unit target and unit pet target as reported on Curse.
The diff can be found here.
Yeh, saw those issues myself. I'll commit what I have shortly. The code can be made simpler by using GUIDs to match them up.
My callback function is paraphrased below:
The name is that of another unit, but the talent tree info is mine.
Any ideas?