Module:Sandbox/LVL: Difference between revisionsGive feedback
Jump to navigation
Jump to search
No edit summary |
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 = "" | |||
-- Build hero icon + small alt-fire label | |||
local hero_name_en = hero_data["Name"] | |||
local template_args = {[1] = hero_name_en, l1 = localize(hero_key, hero_key)} | |||
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>' | |||
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 | |||
if stats_to_include[category] ~= nil then | |||
for _, attr_key in ipairs(stats_to_include[category]) do | |||
if category == "Weapon" then | |||
row_str = row_str .. buildStatCell(hero_data, hero_key, attr_key, true, category) | |||
else | |||
row_str = row_str .. '<td></td>' | |||
end | |||
end | |||
end | |||
end | |||
return '<tr class="alt-fire-sub" data-parent="' .. hero_key .. '">' .. row_str .. '</tr>' | |||
end | |||
-- Build body | -- Build body | ||