Module:Neighbor Journey: Difference between revisions

ReisuDesign (talk | contribs)
m ReisuDesign moved page Module:NeighborJourney to Module:Neighbor Journey without leaving a redirect
ReisuDesign (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 77: Line 77:
local output = {
local output = {
"{| class=\"wikitable wikitable--stripe\"",
"{| class=\"wikitable wikitable--stripe\"",
"! Node !! Quantity !! Title !! {{Item|Dough|notext=1}}"
"! width=155px | Node !! Quantity !! Title !! {{Item|Dough|notext=1}}"
}
}


Line 96: Line 96:
-- Groups
-- Groups
----------------------------------------------------------------
----------------------------------------------------------------
local hasGroup = false


for _, group in ipairs(validGroups) do
for _, group in ipairs(validGroups) do
Line 104: Line 106:
-- Don't output groups that have no rewards.
-- Don't output groups that have no rewards.
if #rewards > 0 then
if #rewards > 0 then
-- Add a separator after Meet / between groups.
table.insert(output, "|-")
table.insert(output,
'! colspan="4" style="height:10px; min-height:5px; padding:0; border:0;" |'
)
hasGroup = true


-- Replace {name} with the neighbor's name.
-- Replace {name} with the neighbor's name.
Line 128: Line 138:
table.insert(output,
table.insert(output,
"| " .. first.quantity ..
"| " .. first.quantity ..
" || '''" .. first.title .. "''' " ..
" || '''" .. first.title .. "''' || " ..
"|| " .. first.dough
first.dough
)
)


Line 139: Line 149:
table.insert(output,
table.insert(output,
"| " .. reward.quantity ..
"| " .. reward.quantity ..
" || '''" .. reward.title .. "''' " ..
" || '''" .. reward.title .. "''' || " ..
"|| " .. reward.dough
reward.dough
)
)
end
end
Line 149: Line 159:
table.insert(output, "|}")
table.insert(output, "|}")


return table.concat(output, "\n")
-- Process generated wikitext so that templates
-- such as {{Icon/Journey}} and {{Item}} are evaluated.
local result = table.concat(output, "\n")
 
return frame:preprocess(result)
end
end


return p
return p