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 837: Line 837:
end
end


local t = mw.html.create("table")
local wrap = mw.html.create("div")
t: addClass("sv-type-table")
wrap: addClass("sv-type-grid")


local added = false
local added = false
Line 852: Line 852:
end
end


local function addRowKV(k, v)
local function addChunk(label, rawVal)
local v = valName(rawVal)
if not v or v == "" then return end
if not v or v == "" then return end
added = true
added = true
local r = t: tag("tr")
 
r: tag("th"): wikitext(mw.text.nowiki(k)): done()
local chunk = wrap: tag("div"): addClass("sv-type-chunk")
r: tag("td"): wikitext(mw.text.nowiki(v)): done()
chunk: tag("div"): addClass("sv-type-label"): wikitext(mw.text.nowiki(label))
chunk: tag("div"): addClass("sv-type-value"): wikitext(mw.text.nowiki(v))
end
end


addRowKV("Type", valName(typeBlock["Damage Type"]))-- renamed from "Damage Type"
addChunk("Type", typeBlock["Damage Type"])
addRowKV("Element", valName(typeBlock["Element Type"]))
addChunk("Element", typeBlock["Element Type"])
addRowKV("Target", valName(typeBlock["Target Type"]))
addChunk("Target", typeBlock["Target Type"])
addRowKV("Cast Type", valName(typeBlock["Cast Type"]))
addChunk("Cast Type", typeBlock["Cast Type"])


if not added then
if not added then
return nil
return nil
end
end
return tostring(t)
return tostring(wrap)
end
end