Line 3: |
Line 3: |
| local NodeInfo = require('Module:NodeInfo') | | local NodeInfo = require('Module:NodeInfo') |
| | | |
− | local title_template_simple = [[<div id="${map} ${node} ${diff}" style="width:700px;text-align:center;">${map} ${node}: ${name}</div> | + | local title_template_simple_event = [[<div id="${map} ${node} ${diff}" style="width:700px;text-align:center;">${map} ${node}: ${name}</div> |
| ]] | | ]] |
| | | |
− | local title_template = [[<div id="${map} ${node} ${diff}" style="width:700px;text-align:center;">${map} ${node}: ${name} ([http://db.kcwiki.moe/drop/map/${event_number}${map_number}/${diff_number}/${node}-SAB.html PoiDB])</div> | + | local title_template_event = [[<div id="${map} ${node} ${diff}" style="width:700px;text-align:center;">${map} ${node}: ${name} ([http://db.kcwiki.moe/drop/map/${event_number}${map_number}/${diff_number}/${node}-SAB.html PoiDB])</div> |
| + | ]] |
| + | |
| + | local title_template_simple = [[<div id="${map} ${node}" style="width:700px;text-align:center;">${map} ${node}: ${name}</div> |
| + | ]] |
| + | |
| + | local title_template = [[<div id="${map} ${node}" style="width:700px;text-align:center;">${map} ${node}: ${name} ([http://db.kcwiki.moe/drop/map/${world_number}${map_number}/${node}-SAB.html PoiDB])</div> |
| ]] | | ]] |
| | | |
| local event_numbers = { | | local event_numbers = { |
| + | ["World 1"] = 1, |
| + | ["World 2"] = 2, |
| + | ["World 3"] = 3, |
| + | ["World 4"] = 4, |
| + | ["World 5"] = 5, |
| + | ["World 6"] = 6, |
| ["Winter 2016 Event"] = 33, | | ["Winter 2016 Event"] = 33, |
| ["Spring 2016 Event"] = 34, | | ["Spring 2016 Event"] = 34, |
Line 46: |
Line 58: |
| | | |
| local node = args[1] or "?" | | local node = args[1] or "?" |
− | local diff = diffs[args.diff] and args.diff or "?" | + | local diff = diffs[args.diff] and args.diff |
| local name = args.name or "?" | | local name = args.name or "?" |
| | | |
| | | |
| local map_number = string.match(map, "%d") or "?" | | local map_number = string.match(map, "%d") or "?" |
− | local diff_number = diffs[diff] or "?" | + | local diff_number = diffs[diff] |
| | | |
− | return format{ | + | return diff and format{ |
− | node == "AB" and title_template_simple or title_template, | + | node == "AB" and title_template_simple_event or title_template_event, |
| map = map, | | map = map, |
| node = node, | | node = node, |
Line 62: |
Line 74: |
| map_number = map_number, | | map_number = map_number, |
| diff_number = diff_number, | | diff_number = diff_number, |
| + | } or format{ |
| + | node == "AB" and title_template_simple or title_template, |
| + | map = map, |
| + | node = node, |
| + | name = name, |
| + | world_number = event_number, |
| + | map_number = map_number, |
| } | | } |
| | | |
Line 71: |
Line 90: |
| local args = Utils.getTemplateArgs(frame) | | local args = Utils.getTemplateArgs(frame) |
| local table_string = NodeInfo:Table(args.explicit) | | local table_string = NodeInfo:Table(args.explicit) |
− | if args.explicit.diff then | + | if args.explicit.diff or args.implicit.pagename and args.implicit.pagename:sub(1, 5) == "World" then |
| return formatTitle(args.implicit.pagename, args.explicit) .. table_string | | return formatTitle(args.implicit.pagename, args.explicit) .. table_string |
| else | | else |