Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Join the Playtest on Steam Now: SpiritVale

Module:GameSkills: Difference between revisions

From SpiritVale Wiki
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:
local icon = rec.Icon
--1) Title row: icon + name centered(single cell)
local title = rec["External Name"] or rec.Name or rec["Internal Name"] or "Unknown Skill"
--2) Description row: its own row below(still part of the hero band)
local desc = rec.Description or ""


local headerRow = root: tag("tr")
local icon = rec.Icon
headerRow: addClass("spiritvale-infobox-main")
local title = rec["External Name"] or rec.Name or rec["Internal Name"] or "Unknown Skill"
local desc = rec.Description or ""


local leftCell = headerRow: tag("th")
--Row 1: icon + title(single column)
leftCell: addClass("spiritvale-infobox-main-left")
local heroRow = root: tag("tr")
heroRow: addClass("spiritvale-infobox-main")
heroRow: addClass("sv-hero-title-row")


local leftInner = leftCell: tag("div")
local heroCell = heroRow: tag("th")
leftInner: addClass("spiritvale-infobox-main-left-inner")
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
leftInner: wikitext(string.format("[[File:%s|80px|link=]]", icon))
heroInner: wikitext(string.format("[[File:%s|80px|link=]]", icon))
end
end


leftInner: tag("div")
heroInner: tag("div")
: addClass("spiritvale-infobox-title")
: addClass("spiritvale-infobox-title")
: wikitext(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 rightCell = headerRow: tag("td")
local descCell = descRow: tag("td")
rightCell: addClass("spiritvale-infobox-main-right")
descCell: attr("colspan", 2)
descCell: addClass("sv-hero-desc-cell")


local rightInner = rightCell: tag("div")
local descInner = descCell: tag("div")
rightInner: addClass("spiritvale-infobox-main-right-inner")
descInner: addClass("spiritvale-infobox-main-right-inner")


if desc ~= "" then
descInner: tag("div")
rightInner: tag("div")
: addClass("spiritvale-infobox-description")
: addClass("spiritvale-infobox-description")
: wikitext(string.format("''%s''", desc))
: wikitext(string.format("''%s''", desc))
end
end