Editing Module:HeroDataArraysGive feedback
Jump to navigation
Jump to search
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 393: | Line 393: | ||
return table.concat(output, "\n\n") | return table.concat(output, "\n\n") | ||
end | |||
p.heroMoveSpeedTable = function(frame) | |||
local heroMoveSpeedData = heroDataArray({"Name", "MoveSpeed"}) | |||
local rows = {} | |||
for name, data in pairs(heroMoveSpeedData) do | |||
table.insert(rows, { | |||
name = name, | |||
moveSpeed = data["MoveSpeed"] or 0 | |||
}) | |||
end | |||
table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | |||
local z = "{| class=\"wikitable sortable mw-collapsible\" style=\"text-align:center\" \n".. | |||
"|+ Base Movement Speed \n".. | |||
"! Hero !! m/s \n" | |||
for _, r in ipairs(rows) do | |||
z = z.. | |||
"|- \n".. | |||
"| style=\"text-align:left;\" | ".. | |||
frame:expandTemplate{title="PageRef", args={r.name}}.. | |||
" || "..r.moveSpeed.." \n" | |||
end | |||
z = z.."|}" | |||
return z | |||
end | end | ||