Module:Sandbox/LVL: Difference between revisions

Jump to navigation Jump to search
LVL (talk | contribs)
No edit summary
LVL (talk | contribs)
No edit summary
Line 187: Line 187:
     -- Alt-fire sub-row – contains a smaller hero label + only weapon cells
     -- Alt-fire sub-row – contains a smaller hero label + only weapon cells
     local function generateAltFireSubRow(hero_data, hero_key)
     local function generateAltFireSubRow(hero_data, hero_key)
        local row_str = ""
    local row_str = ""
        -- Hero cell: just a subtle "(Alt-fire)" label, same sticky styling
   
        row_str = row_str .. '<td style="position: sticky; left: 0; z-index: 9; background-color: #202122; isolation: isolate; font-size: 0.85em; color: #aaa;">(Alt‑fire)</td>'
    -- Build hero icon + small alt-fire label
 
    local hero_name_en = hero_data["Name"]
        for _, category in ipairs(attribute_orders["category_order"]) do
    local template_args = {[1] = hero_name_en, l1 = localize(hero_key, hero_key)}
            if stats_to_include[category] ~= nil then
    local hero_icon = mw.getCurrentFrame():expandTemplate{ title = "Template:HeroIcon", args = template_args }
                for _, attr_key in ipairs(stats_to_include[category]) do
    local hero_cell_content = hero_icon .. ' <small style="color:#aaa;">(Alt‑fire)</small>'
                    if category == "Weapon" then
   
                        row_str = row_str .. buildStatCell(hero_data, hero_key, attr_key, true, category)
    row_str = row_str .. '<td style="position: sticky; left: 0; z-index: 9; background-color: #202122; isolation: isolate;">' .. hero_cell_content .. '</td>'
                    else
                        -- empty cell to keep column layout
    for _, category in ipairs(attribute_orders["category_order"]) do
                        row_str = row_str .. '<td></td>'
        if stats_to_include[category] ~= nil then
                    end
            for _, attr_key in ipairs(stats_to_include[category]) do
                end
                if category == "Weapon" then
            end
                    row_str = row_str .. buildStatCell(hero_data, hero_key, attr_key, true, category)
        end
                else
        return '<tr class="alt-fire-sub" data-parent="' .. hero_key .. '">' .. row_str .. '</tr>'
                    row_str = row_str .. '<td></td>'
    end
                end
            end
        end
    end
   
    return '<tr class="alt-fire-sub" data-parent="' .. hero_key .. '">' .. row_str .. '</tr>'
end


     -- Build body
     -- Build body