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:GamePassives: Difference between revisions

From SpiritVale Wiki
No edit summary
No edit summary
Line 330: Line 330:


     -- ==========================================================
     -- ==========================================================
     -- Top "hero" row: icon + name (left), description (right)
     -- 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 headerRow = root:tag("tr")
    -- Row 1: centered icon + title (single cell)
     headerRow:addClass("spiritvale-infobox-main")
     local titleRow = root:tag("tr")
     titleRow:addClass("spiritvale-infobox-main")
    titleRow:addClass("sv-hero-title-row")


    -- Left cell: icon + name
     local titleCell = titleRow:tag("th")
     local leftCell = headerRow:tag("th")
     titleCell:attr("colspan", 2)
     leftCell:addClass("spiritvale-infobox-main-left")


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


     leftInner:tag("div")
     titleInner:tag("div")
         :addClass("spiritvale-infobox-title")
         :addClass("spiritvale-infobox-title")
         :wikitext(title)
         :wikitext(title)


     -- Right cell: italic description
     -- Row 2: description (single cell)
     local rightCell = headerRow:tag("td")
     if desc ~= "" then
    rightCell:addClass("spiritvale-infobox-main-right")
        local descRow = root:tag("tr")
        descRow:addClass("spiritvale-infobox-main")
        descRow:addClass("sv-hero-desc-row")


    local rightInner = rightCell:tag("div")
        local descCell = descRow:tag("td")
    rightInner:addClass("spiritvale-infobox-main-right-inner")
        descCell:attr("colspan", 2)


    if desc ~= "" then
        local descInner = descCell:tag("div")
         rightInner: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))