Module:GameSkills: Difference between revisions
From SpiritVale Wiki
More actions
No edit summary |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 498: | Line 498: | ||
root:addClass("wikitable spiritvale-skill-infobox") | root:addClass("wikitable spiritvale-skill-infobox") | ||
-- | -- ========================================================== | ||
-- Top "hero" row: icon + name (left), description (right) | |||
-- ========================================================== | |||
local icon = rec.Icon | local icon = rec.Icon | ||
local title = rec.Name or rec["Internal Name"] or "Unknown Skill" | local title = rec.Name or rec["Internal Name"] or "Unknown Skill" | ||
local desc = rec.Description or "" | |||
local | local headerRow = root:tag("tr") | ||
local | headerRow:addClass("spiritvale-infobox-main") | ||
-- Left cell: icon + name | |||
local leftCell = headerRow:tag("th") | |||
leftCell:addClass("spiritvale-infobox-main-left") | |||
local leftInner = leftCell:tag("div") | |||
leftInner:addClass("spiritvale-infobox-main-left-inner") | |||
if icon and icon ~= "" then | if icon and icon ~= "" then | ||
leftInner:wikitext(string.format("[[File:%s|80px|link=]]", icon)) | |||
end | |||
leftInner:tag("div") | |||
:addClass("spiritvale-infobox-title") | |||
:wikitext(title) | |||
-- Right cell: italic description | |||
local rightCell = headerRow:tag("td") | |||
rightCell:addClass("spiritvale-infobox-main-right") | |||
local rightInner = rightCell:tag("div") | |||
rightInner:addClass("spiritvale-infobox-main-right-inner") | |||
if desc ~= "" then | |||
rightInner:tag("div") | |||
:addClass("spiritvale-infobox-description") | |||
:wikitext(string.format("''%s''", desc)) | |||
end | end | ||
------------------------------------------------------------------ | ------------------------------------------------------------------ | ||
| Line 517: | Line 540: | ||
------------------------------------------------------------------ | ------------------------------------------------------------------ | ||
addSectionHeader(root, "General") | addSectionHeader(root, "General") | ||
addRow(root, "Description", rec.Description) | |||
-- Description now lives in the hero row. | |||
-- addRow(root, "Description", rec.Description) | |||
addRow(root, "Max level", rec["Max Level"] and tostring(rec["Max Level"])) | addRow(root, "Max level", rec["Max Level"] and tostring(rec["Max Level"])) | ||