Module:GameSkills: Difference between revisions
From SpiritVale Wiki
More actions
No edit summary |
No edit summary |
||
| Line 926: | Line 926: | ||
root: attr("data-level", tostring(level)) | root: attr("data-level", tostring(level)) | ||
--Top "hero" row | --Top "hero" rows: | ||
--1) Title row: icon + name centered(single cell) | |||
--2) Description row: its own row below(still part of the hero band) | |||
local icon = rec.Icon | |||
local title = rec["External Name"] or rec.Name or rec["Internal Name"] or "Unknown Skill" | |||
local desc = rec.Description or "" | |||
--Row 1: icon + title(single column) | |||
local heroRow = root: tag("tr") | |||
heroRow: addClass("spiritvale-infobox-main") | |||
heroRow: addClass("sv-hero-title-row") | |||
local heroCell = heroRow: tag("th") | |||
heroCell: attr("colspan", 2) | |||
heroCell: addClass("sv-hero-title-cell") | |||
local heroInner = heroCell: tag("div") | |||
heroInner: addClass("spiritvale-infobox-main-left-inner")-- reuse your centered flex column | |||
if icon and icon ~= "" then | if icon and icon ~= "" then | ||
heroInner: wikitext(string.format("[[File:%s|80px|link=]]", icon)) | |||
end | end | ||
heroInner: tag("div") | |||
: addClass("spiritvale-infobox-title") | |||
: wikitext(title) | |||
--Row 2: description(below, still hero - styled) | |||
if desc ~= "" then | |||
local descRow = root: tag("tr") | |||
descRow: addClass("spiritvale-infobox-main") | |||
descRow: addClass("sv-hero-desc-row") | |||
local | local descCell = descRow: tag("td") | ||
descCell: attr("colspan", 2) | |||
descCell: addClass("sv-hero-desc-cell") | |||
local | local descInner = descCell: tag("div") | ||
descInner: addClass("spiritvale-infobox-main-right-inner") | |||
descInner: tag("div") | |||
: addClass("spiritvale-infobox-description") | |||
: wikitext(string.format("''%s''", desc)) | |||
end | end | ||