Module:Sandbox/LVL: Difference between revisions

LVL (talk | contribs)
No edit summary
LVL (talk | contribs)
No edit summary
Line 329: Line 329:
         local template_args = {[1] = hero_name_en, l1 = hero_name_local}
         local template_args = {[1] = hero_name_en, l1 = hero_name_local}
         local hero_icon = mw.getCurrentFrame():expandTemplate{ title = "Template:HeroIcon", args = template_args }
         local hero_icon = mw.getCurrentFrame():expandTemplate{ title = "Template:HeroIcon", args = template_args }
         local hero_cell_content = hero_icon
        local hero_name_display = '<span style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: inline-block; max-width: 120px; vertical-align: middle;">' .. hero_icon .. '</span>'
         local hero_cell_content = hero_name_display
         if has_alt then
         if has_alt then
             local tooltip_html = mw.getCurrentFrame():expandTemplate{
             local tooltip_html = mw.getCurrentFrame():expandTemplate{
Line 335: Line 336:
                 args = { '+', 'Toggle Alt‑fire stats' }
                 args = { '+', 'Toggle Alt‑fire stats' }
             }
             }
             hero_cell_content = '[[#alt-fire-' .. hero_key .. '|' .. tooltip_html .. ']] ' .. hero_cell_content
             hero_cell_content = '[[#alt-fire-' .. hero_key .. '|' .. tooltip_html .. ']] ' .. hero_name_display
         end
         end
         row_str = row_str .. '<td style="position: sticky; left: 0; z-index: 10; background-color: #202122; isolation: isolate; overflow: hidden;">' .. hero_cell_content .. '</td>'
         row_str = row_str .. '<td style="position: sticky; left: 0; z-index: 10; background-color: #202122; isolation: isolate;">' .. hero_cell_content .. '</td>'
         for _, category in ipairs(attribute_orders["category_order"]) do
         for _, category in ipairs(attribute_orders["category_order"]) do
             if stats_to_include[category] ~= nil then
             if stats_to_include[category] ~= nil then
Line 356: Line 357:
         local hero_icon = mw.getCurrentFrame():expandTemplate{ title = "Template:HeroIcon", args = template_args }
         local hero_icon = mw.getCurrentFrame():expandTemplate{ title = "Template:HeroIcon", args = template_args }
         local hero_cell_content = hero_icon .. ' <small style="color:#aaa;">(Alt‑fire)</small>'
         local hero_cell_content = hero_icon .. ' <small style="color:#aaa;">(Alt‑fire)</small>'
         row_str = row_str .. '<td style="position: sticky; left: 0; z-index: 9; background-color: #202122; isolation: isolate; overflow: hidden;">' .. hero_cell_content .. '</td>'
         row_str = row_str .. '<td style="position: sticky; left: 0; z-index: 9; background-color: #202122; isolation: isolate;">' .. hero_cell_content .. '</td>'
         for _, category in ipairs(attribute_orders["category_order"]) do
         for _, category in ipairs(attribute_orders["category_order"]) do
             if stats_to_include[category] ~= nil then
             if stats_to_include[category] ~= nil then