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
(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")


     -- Header: icon + name
     -- ==========================================================
    -- 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 header = root:tag("tr")
     local headerRow = root:tag("tr")
     local headerCell = header:tag("th")
    headerRow:addClass("spiritvale-infobox-main")
     headerCell:attr("colspan", 2)
 
    -- 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")


    local titleText = ""
     if icon and icon ~= "" then
     if icon and icon ~= "" then
         titleText = string.format("[[File:%s|64px|link=]] ", icon)
         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
    titleText = titleText .. title
    headerCell:wikitext(titleText)


     ------------------------------------------------------------------
     ------------------------------------------------------------------
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"]))