Module:TabbedDialogue

local p = {}

function p.main(frame) local args = require("Dev:Arguments").getArgs(frame) local result = {} local i_title = 0 local i_event local title, event, dialogue table.insert(result, ' ') while true do		i_title = i_title + 1 title = args['Title' .. i_title] -- if (title and (string.len(title) > 0)) or (i_title == 1) then table.insert(result, '|-| ' .. (title or ' ') .. '=') table.insert(result, ' ' .. (title or ' ') .. ' ') table.insert(result, '{| class="dialogue-table__inner"') i_event = 0 while true do				i_event = i_event + 1 event = args['Title' .. i_title .. '_Event' .. i_event] or nil -- dialogue = args['Title' .. i_title .. '_Dialogue' .. i_event] or nil -- if event or dialogue then table.insert(result, '|-') table.insert(result, '! class="td-title" scope="row" | ' .. (event or '')) table.insert(result, '| ' .. (dialogue or '')) else table.insert(result, '|}') break end end else break end end table.insert(result, ' ') return frame:preprocess(table.concat(result, '\n')) end

return p