Thread Tools Display Modes
08-25-12, 05:55 AM   #1
Helza
A Defias Bandit
Join Date: Mar 2012
Posts: 3
RaidChecklist, using LibGroupTalents help

Does anyone have up MoP compatible version of LibGroupTalents?

I'm trying to update RaidChecklist which uses LibGroupTalents extensively.
I've already fixed the simple functions that are renamed, however when checking my talents using GUIDHasTalent(guid, entry.n) its unable to find me talent even tough i have them

I think the main culprit is ReadTalentGroup which i've tried to fix, but had more structural changes then the other functions and apperently isnt loading the talent list correctly.

Maybe someone can see what i ****ed up, or has an working version?

external link removed



i changed for example

Code:
local function ReadTalentGroup(isnotplayer, group, class)
	local numTabs = GetNumTalentTabs(isnotplayer)
	if (numTabs and numTabs >= 3 and GetNumTalents(1, isnotplayer) > 0) then
		local ctd = lib.classTalentData[class]
--[===[@debug@
assert(ctd and ctd[1] and ctd[2] and ctd[3])
assert(ctd[1].list and ctd[2].list and ctd[3].list)
--@end-debug@]===]

		local n = new()
		for tab = 1, numTabs do
			local branchLength = GetNumTalents(tab, isnotplayer)
			if (branchLength ~= #ctd[tab].list) then
				-- Tab tree size is not what we expected for this class
				del(n)
				return
			end

			local t = new()
			local trim
			for i = 1,branchLength do
				local name, icon, tier, column, currentRank, maxRank = GetTalentInfo(tab, i, isnotplayer, nil, group)
				tinsert(t, currentRank)
				if (currentRank > 0) then
					trim = i			-- We strip off trailing zeros from talent strings to save storage space
				end
			end

			tinsert(n, table.concat(t, nil, 1, trim or 0))
			del(t)
		end

		return n
	end
end
to use

Code:
local function ReadTalentGroup(isnotplayer, group, class)
	local numTabs = GetNumSpecializations(isnotplayer)
	if (numTabs and numTabs >= 3 and GetNumTalents(1, isnotplayer) > 0) then
		local ctd = lib.classTalentData[class]
--[===[@debug@
assert(ctd and ctd[1] and ctd[2] and ctd[3])
assert(ctd[1].list and ctd[2].list and ctd[3].list)
--@end-debug@]===]

		local n = new()
		for tab = 1, numTabs do
			local branchLength = GetNumTalents(tab, isnotplayer)
			if (branchLength ~= #ctd[tab].list) then
				-- Tab tree size is not what we expected for this class
				del(n)
				return
			end

			local found = false
			local t = new()
			local trim
			for i = 1,branchLength do
				local name, icon, tier, column, selected , available  = GetTalentInfo(i, isnotplayer, tab, isnotplayer, class)
				if (selected) then
					tinsert(t, tostring(selected))
					found = true
					--trim = i			-- We strip off trailing zeros from talent strings to save storage space
				end
			end
			tinsert(n, table.concat(t, nil, 1, trim or 0))
			del(t)
		end

		return n
	end
end
so it won crash anymore, but talents are not being loaded correctly (although i have no idea how this result is being used)

Last edited by Haleth : 08-25-12 at 09:25 AM.
 
08-25-12, 08:44 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
1) Off-site file links are not allowed here. You should link to the addon's official download page. If you want to show us your code, use [code] blocks for smaller snippets, or see the links in my signature for longer sections or whole files.

2) The talent system was completely redone in MoP; every part of the API has changed, not just the function names. The entire library will likely need major work. Given that the last release was over a year ago 2011, though, I'd have to say the chances of it being updated are slim to none, and you should probably direct your effort into finding another addon to use that doesn't depend on an abandoned library.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
08-25-12, 11:47 AM   #3
Helza
A Defias Bandit
Join Date: Mar 2012
Posts: 3
I wasn't linking the original addon, i was linking the modified addon i've done, so maybe someone could help out. Using pastebin is meant for 1 file, not multiple files. You do say you want people to show the complete code, shouldnt make that much difference where the files are uploaded isnt it?

Anyway, i know the talent system has been overhauled so i was just trying to get fix the functions of the library thats used back to work without having to rewrite the complete library, but i guess its more complicated then i guessed.

any MoP library which easily allows you to check talents your party / raid members have ?
 
 

WoWInterface » Site Forums » Archived Beta Forums » MoP Beta archived threads » RaidChecklist, using LibGroupTalents help

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off