Module:Calculator/AgilityObstacle: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 190: Line 190:
     -- Put GP and SC at the top, and remove them from the list
     -- Put GP and SC at the top, and remove them from the list
     -- to avoid sorting and re-adding them below.
     -- to avoid sorting and re-adding them below.
     local gpVal = table.remove(courseItems, 'GP')
     if courseItems['GP'] then ul:tag('li'):wikitext(getItemIcon('GP', courseItems['GP'])) end
    local scVal = table.remove(courseItems, 'SC')
     if courseItems['SC'] then ul:tag('li'):wikitext(getItemIcon('SC', courseItems['SC'])) end
   
    if gpVal then ul:tag('li'):wikitext(getItemIcon('GP', gpVal)) end
     if scVal then ul:tag('li'):wikitext(getItemIcon('SC', scVal)) end


courseItems['GP'] = nil
courseItems['SC'] = nil
     local itemList = Shared.sortDictionary(courseItems,  
     local itemList = Shared.sortDictionary(courseItems,  
     function(a, b) return a.item < b.item end,
     function(a, b) return a.item < b.item end,
2,875

edits