Thread Tools Display Modes
Prev Previous Post   Next Post Next
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.
 
 

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


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