# HG changeset patch # User John@Yosemite-PC # Date 1332386611 14400 # Node ID 11f18e279229cf8661ef2696a0ffaab321a3d5cf # Parent b155a875de4267569b4e8a97015594e4eec640cf Updating to use the new APIs diff -r b155a875de42 -r 11f18e279229 Gui.lua --- a/Gui.lua Wed Mar 21 23:23:06 2012 -0400 +++ b/Gui.lua Wed Mar 21 23:23:31 2012 -0400 @@ -76,18 +76,8 @@ if color == nil then return str end return "|cff"..tostring(color or "ffffff")..str.."|r" end - local pull = {} - local ltemp = 0 - for i,v in pairs(lists) do - pull[i] = v.name - --local entry = {value=i,text=v.name} - if ltemp == 0 and getn(v) > 0 then - ltemp = i - end - end - PopulateRaidList() -- todo: this should be elsewhere - + PersonList:RefreshRaidList() -- todo: this should be elsewhere scroller = AceGUI:Create("ScrollFrame") scroller:SetLayout("List") @@ -109,24 +99,38 @@ treecontrol:AddChild(scroller) local pulldown = AceGUI:Create("Dropdown") + local pull = {} + local ltemp = 0 + local lids = LootLists:GetAllIds() + for _,v in pairs(lids) do + local l = LootLists:Select(v) + pull[l:GetId()] = l:GetName() + --local entry = {value=i,text=v.name} + if l:GetLength() > 0 then + pulldown:SetItemDisabled(i,true) + if ltemp == 0 then + ltemp = l:GetId() + end + end + end pulldown:SetWidth(175) pulldown:SetList(pull) - for i,v in pairs(lists) do - if getn(v) == 0 then - pulldown:SetItemDisabled(i,true) - end - end + --for i,v in pairs(lists) do + -- if getn(v) == 0 then + -- pulldown:SetItemDisabled(i,true) + -- end + --end local ovc = function(_,_,value) --treecontrol:ReleaseChildren() local tree = {} - for x,y in ipairs(lists[value]) do - local p = persons[y.id] - local line = {value=y.id,text=p.main,icon=[[Interface\Glues\CharacterCreate\UI-CharacterCreate-Classes]]} - line.iconCoords=_G.CLASS_ICON_TCOORDS[p.class] - if not raidIdP[y.id] and not reserveIdP[y.id] then + local l = LootLists:Select(value) + for le in l:OrderedListEntryIter() do + local line = {value=le:GetId(),text=le:GetName(),icon=[[Interface\Glues\CharacterCreate\UI-CharacterCreate-Classes]]} + line.iconCoords=_G.CLASS_ICON_TCOORDS[le:GetClass()] + if not PersonList:IsActive(le:GetId()) then line.disabled = true else - line.text=colorize(line.text,_G.RAID_CLASS_COLORS[p.class]) + line.text=colorize(line.text,_G.RAID_CLASS_COLORS[le:GetClass()]) end table.insert(tree,line) end