WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   MoP Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=162)
-   -   RaidChecklist, using LibGroupTalents help (https://www.wowinterface.com/forums/showthread.php?t=43952)

Helza 08-25-12 05:55 AM

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)

Phanx 08-25-12 08:44 AM

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.

Helza 08-25-12 11:47 AM

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 ?


All times are GMT -6. The time now is 02:27 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI