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 923: Line 923:
local hasNotes = (#notesList > 0)
local hasNotes = (#notesList > 0)
local hasReq = (#reqSkills > 0) or (#reqWeapons > 0) or (#reqStances > 0)
local hasReq = (#reqSkills > 0) or (#reqWeapons > 0) or (#reqStances > 0)


local wrap = mw.html.create("div")
local wrap = mw.html.create("div")
Line 938: Line 939:
textBox:addClass("sv-herobar-text")
textBox:addClass("sv-herobar-text")


local notesBtn
local titleRow = textBox:tag("div")
titleRow:addClass("sv-herobar-title-row")
 
local titleBox = titleRow:tag("div")
titleBox:addClass("spiritvale-infobox-title")
titleBox:wikitext(title)
 
if hasNotes then
if hasNotes then
notesBtn = mw.html.create("span")
local notesBtn = mw.html.create("span")
notesBtn:addClass("sv-tip-btn sv-tip-btn--notes")
notesBtn:addClass("sv-tip-btn sv-tip-btn--notes")
notesBtn:attr("role", "button")
notesBtn:attr("role", "button")
Line 948: Line 955:
notesBtn:attr("aria-expanded", "false")
notesBtn:attr("aria-expanded", "false")
notesBtn:tag("span"):addClass("sv-ico sv-ico--info"):attr("aria-hidden", "true"):wikitext("i")
notesBtn:tag("span"):addClass("sv-ico sv-ico--info"):attr("aria-hidden", "true"):wikitext("i")
titleRow:node(notesBtn)
end
end
if notesBtn and icon and icon ~= "" then
iconBox:node(notesBtn)
elseif notesBtn then
textBox:node(notesBtn)
end
local titleBox = textBox:tag("div")
titleBox:addClass("spiritvale-infobox-title")
titleBox:wikitext(title)


if hasReq then
if hasReq then
local pillRow = textBox:tag("div")
local pillRow = wrap:tag("div")
pillRow:addClass("sv-pill-row")
pillRow:addClass("sv-pill-row")
local pill = mw.html.create("span")
pillRow:addClass("sv-pill-row--req")
local pill = pillRow:tag("span")
pill:addClass("sv-pill sv-pill--req sv-tip-btn")
pill:addClass("sv-pill sv-pill--req sv-tip-btn")
pill:attr("role", "button")
pill:attr("role", "button")
Line 971: Line 970:
pill:attr("aria-expanded", "false")
pill:attr("aria-expanded", "false")
pill:wikitext("Requirements")
pill:wikitext("Requirements")
pillRow:node(pill)
end
end