Module:Obstacles/Recommended: Difference between revisions

m
should work i think
mNo edit summary
m (should work i think)
Line 13: Line 13:
{ tier = 4, name = 'obs4', icon = 'Agility', txt = 'IV', link = 'Agility#Obstacle 4' },
{ tier = 4, name = 'obs4', icon = 'Agility', txt = 'IV', link = 'Agility#Obstacle 4' },
{ tier = 5, name = 'obs5', icon = 'Agility', txt = 'V', link = 'Agility#Obstacle 5' },
{ tier = 5, name = 'obs5', icon = 'Agility', txt = 'V', link = 'Agility#Obstacle 5' },
{ tier = 6, name = 'obs 6', icon = 'Agility', txt = 'VI', link = 'Agility#Obstacle 6' },
{ tier = 6, name = 'obs6', icon = 'Agility', txt = 'VI', link = 'Agility#Obstacle 6' },
{ tier = 7, name = 'obs7', icon = 'Agility', txt = 'VII', link = 'Agility#Obstacle 7' },
{ tier = 7, name = 'obs7', icon = 'Agility', txt = 'VII', link = 'Agility#Obstacle 7' },
{ tier = 8, name = 'obs8', icon = 'Agility', txt = 'VIII', link = 'Agility#Obstacle 8' },
{ tier = 8, name = 'obs8', icon = 'Agility', txt = 'VIII', link = 'Agility#Obstacle 8' },
Line 22: Line 22:


function p.main(frame)
function p.main(frame)
local args = frame:getParent().args
-- local args = frame:getParent().args
local args = frame.args
-- Dynamic colspan and N/A generation value
-- Dynamic colspan and N/A generation value
local greatest_row_size = 0
local greatest_row_size = 0
Line 38: Line 39:
end
end
for _, v in ipairs(data) do
for _, v in ipairs(data) do
local itemicon = icons.Icon({v, img=v, type='item'})
local obstaclename = tr:tag('td'):wikitext(string.format('[[Agility#%s|%s]]', v, v))
local obstaclename = tr:tag('td'):wikitext(string.format('[[%s|%s]]', v.link, v.txt))
if compact then
if compact then
obstaclename:attr('style', 'padding-left: 12px;')
obstaclename:attr('style', 'padding-left: 12px;')
Line 86: Line 86:
local row_data = {}
local row_data = {}
for i = 1, number_of_possible_choices, 1 do
for i = 1, number_of_possible_choices, 1 do
local gear = args[v.name .. i]
local obstacle = args[v.name .. i]
if gear and params.has_content(gear) then
if obstacle and params.has_content(obstacle) then
table.insert(row_data, gear)
table.insert(row_data, obstacle)
end
end
end
end
892

edits