Module:TeamTotoSandbox: Difference between revisions
mNo edit summary |
No edit summary |
||
Line 211: | Line 211: | ||
function p.shaderlist() | function p.shaderlist() | ||
local tblheader = '<tr><th>Shader</th><th>Colors</th><th>Type</th></tr>' | local tblheader = '<tr><th>Shader</th><th>Colors</th><th>Type</th></tr>' | ||
local tr = {} | local tr = {} | ||
local sorted_shaders = {} | |||
for a | -- Sort keys -- | ||
tr[i] = ' <tr><td | for n in pairs(shader) do table.insert(sorted_shaders, n) end | ||
table.sort(sorted_shaders) | |||
-- Do logic on the sorted table -- | |||
for i, a in ipairs(sorted_shaders) do | |||
local v = shader[a] | |||
tr[i] = ' <tr><td>' .. applytemplate(a, a, 'true') .. '</td><td>' .. v[1] .. '</td><td>' .. v[2] .. '</td></tr>' | |||
end | end | ||
return '<table class="wikitable sortable">' .. tblheader .. table.concat(tr) .. '</table>' | return '<table class="wikitable sortable">' .. tblheader .. table.concat(tr) .. '</table>' |