Line 79: |
Line 79: |
| end | | end |
| | | |
− | -- header args | + | local boss_nodes = {} |
− | local boss = args.boss and string.upper(args.boss) or '?'
| + | for boss_node_ in string.gmatch(args.boss or "", args_grammar.comma_list) do |
| + | local boss_node = boss_node_:match(args_grammar.node) |
| + | if boss_node then |
| + | local boss_node = string.upper(boss_node) |
| + | if find(boss_nodes, boss_node) then |
| + | log('boss node duplicate', boss_node) |
| + | else |
| + | table.insert(boss_nodes, boss_node) |
| + | end |
| + | else |
| + | log('boss node syntax error', boss_node_) |
| + | end |
| + | end |
| + | if #boss_nodes == 0 then |
| + | log('warning', 'no boss node(s) specified') |
| + | end |
| + | |
| for node_ in string.gmatch(args.nodes, args_grammar.comma_list) do | | for node_ in string.gmatch(args.nodes, args_grammar.comma_list) do |
| local node = node_:match(args_grammar.node) | | local node = node_:match(args_grammar.node) |
Line 88: |
Line 104: |
| log('node duplicate', node) | | log('node duplicate', node) |
| else | | else |
− | table.insert(tbl.nodes, { name = node, boss = node == boss }) | + | local is_boss = find(boss_nodes, node) |
| + | table.insert(tbl.nodes, { name = node, boss = is_boss }) |
| end | | end |
| else | | else |
Line 94: |
Line 111: |
| end | | end |
| end | | end |
− | if not find(tbl.nodes, boss, 'name') then | + | for _, boss_node in pairs(boss_nodes) do |
− | log('boss node ignored', boss)
| + | if not find(tbl.nodes, boss_node, 'name') then |
| + | log('boss node ignored', boss_node) |
| + | end |
| end | | end |
| | | |
Line 233: |
Line 252: |
| local DropList = {} | | local DropList = {} |
| | | |
− | function DropList.show(frame) | + | function DropList.show(frame, args_) |
− | local args = getArgs{frame = frame:getParent()} | + | local args = args_ or getArgs{frame = frame:getParent()} |
| return showTable(parseArgs(args)) | | return showTable(parseArgs(args)) |
| end | | end |
| + | |
| + | -- DropList.test = DropList.show(nil, {nodes = "A,B,C", boss="A,B"}) |
| | | |
| return DropList | | return DropList |