Module:GamePassives: Difference between revisions
From SpiritVale Wiki
More actions
No edit summary |
No edit summary |
||
| Line 330: | Line 330: | ||
-- ========================================================== | -- ========================================================== | ||
-- Top "hero" row | -- Top "hero" rows: title row (icon + name), then description row | ||
-- (Matches the Skill infobox style) | |||
-- ========================================================== | -- ========================================================== | ||
local icon = rec.Icon | local icon = rec.Icon | ||
| Line 336: | Line 337: | ||
local desc = rec.Description or "" | local desc = rec.Description or "" | ||
local | -- Row 1: centered icon + title (single cell) | ||
local titleRow = root:tag("tr") | |||
titleRow:addClass("spiritvale-infobox-main") | |||
titleRow:addClass("sv-hero-title-row") | |||
local titleCell = titleRow:tag("th") | |||
local | titleCell:attr("colspan", 2) | ||
local | local titleInner = titleCell:tag("div") | ||
titleInner:addClass("spiritvale-infobox-main-left-inner") | |||
if icon and icon ~= "" then | if icon and icon ~= "" then | ||
titleInner:wikitext(string.format("[[File:%s|80px|link=]]", icon)) | |||
end | end | ||
titleInner:tag("div") | |||
:addClass("spiritvale-infobox-title") | :addClass("spiritvale-infobox-title") | ||
:wikitext(title) | :wikitext(title) | ||
-- | -- Row 2: description (single cell) | ||
local | if desc ~= "" then | ||
local descRow = root:tag("tr") | |||
descRow:addClass("spiritvale-infobox-main") | |||
descRow:addClass("sv-hero-desc-row") | |||
local descCell = descRow:tag("td") | |||
descCell:attr("colspan", 2) | |||
local descInner = descCell:tag("div") | |||
descInner:addClass("spiritvale-infobox-main-right-inner") | |||
descInner:tag("div") | |||
:addClass("spiritvale-infobox-description") | :addClass("spiritvale-infobox-description") | ||
:wikitext(string.format("''%s''", desc)) | :wikitext(string.format("''%s''", desc)) | ||