Editing Module:AbilityTable

Warning: You are not logged in. Once you make an edit, a temporary account will be created for you. Learn more. Log in or create an account to continue receiving notifications after this account expires, and to access other features.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 326: Line 326:
     end
     end
     table.insert(out, header_row)
     table.insert(out, header_row)
        local hero_counts = {}
    for _, key in ipairs(filtered) do
        local hero = views[key].heroName
        hero_counts[hero] = (hero_counts[hero] or 0) + 1
    end
    local hero_seen = {}


     for _, key in ipairs(filtered) do
     for _, key in ipairs(filtered) do
         local entry  = views[key]
         local entry  = views[key]
         local ability = entry.view
         local ability = entry.view
        local hero    = entry.heroName


         local ability_cell = frame:expandTemplate{
        local hero_cell    = frame:expandTemplate{ title = "HeroIcon", args = { entry.heroName } }
            title = "AbilityIcon",
         local ability_cell = frame:expandTemplate{ title = "AbilityIcon", args = { ability["Name"] } }
            args = { ability["Name"] }
        }


         local extra = get_cells(ability)
         local extra = get_cells(ability)
         enrich_notes_full(extra, stat_notes and stat_notes[ability["Name"]])
         enrich_notes_full(extra, stat_notes and stat_notes[ability["Name"]])


         local row
         local row = '| class="ability-table-cell-hero" | '     .. hero_cell
 
                .. ' || class="ability-table-cell-ability" | ' .. ability_cell
        if not hero_seen[hero] then
            local hero_cell = frame:expandTemplate{
                title = "HeroIcon",
                args = { hero }
            }
 
            if hero_counts[hero] > 1 then
                row = '| rowspan="' .. hero_counts[hero] .. '" class="ability-table-cell-hero" | '
                    .. hero_cell
                    .. ' || class="ability-table-cell-ability" | ' .. ability_cell
            else
                row = '| class="ability-table-cell-hero" | '
                    .. hero_cell
                    .. ' || class="ability-table-cell-ability" | ' .. ability_cell
            end
 
            hero_seen[hero] = true
        else
            row = '| class="ability-table-cell-ability" | ' .. ability_cell
        end
 
         for _, header in ipairs(final_headers) do
         for _, header in ipairs(final_headers) do
             local value = extra[header]
             local value = extra[header]
Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see Deadlock:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template

Page included on this page: