Line 2: |
Line 2: |
| | | |
| function p.formatShipDropTable(tableInfo) | | function p.formatShipDropTable(tableInfo) |
− | -- Lazy. Will modify later to be more like Infobox module
| |
− | local html = "<ol><li>Symbols<ul><li>X = Obtainable <b>only</b> in boss nodes</li><li>O = Obtainable in any node beside the boss node</li></ul></li><li>Unless specified, all ships are obtainable through crafting.<ul><li>Ships that only craftable through Large Ship Construction (LSC) will have notes specified (<i>LSC Crafting</i>)</li></ul></li></ol>"
| |
− | html = html .. '<table class="wikitable" style="text-align: center; width:100%;"><tr><th colspan="1" rowspan="2" style="width:3%;"> No.</th><th colspan="1" rowspan="2" style="width:2%;"> Rarity</th><th colspan="1" rowspan="2" style="width:10%;"> Ship Name</th><th colspan="1" rowspan="3" style="background-color: #dddcb1; width:.8%;"></th><th colspan="5" rowspan="1" style="width:12.5%;"> [[World_1:_%E9%8E%AE%E5%AE%88%E5%BA%9C%E6%B5%B7%E5%9F%9F | World 1]]</th><th colspan="1" rowspan="3" style="background-color: #dddcb1; width:.8%;"></th><th colspan="5" rowspan="1" style="width:12.5%;"> [[World_2:_%E5%8D%97%E8%A5%BF%E8%AB%B8%E5%B3%B6%E6%B5%B7%E5%9F%9F | World 2]]</th><th colspan="1" rowspan="3" style="background-color: #dddcb1; width:.8%;"></th><th colspan="5" rowspan="1" style="width:12.5%;"> [[World_3:_%E5%8C%97%E6%96%B9%E6%B5%B7%E5%9F%9F | World 3]]</th><th colspan="1" rowspan="3" style="background-color: #dddcb1; width:.8%;"></th><th colspan="5" rowspan="1" style="width:11%;"> [[World_4:_%E8%A5%BF%E6%96%B9%E6%B5%B7%E5%9F%9F | World 4]]</th><th colspan="1" rowspan="3" style="background-color: #dddcb1; width:.8%;"></th><th colspan="5" rowspan="1" style="width:12.5%;"> [[World_5:_%E5%8D%97%E6%96%B9%E6%B5%B7%E5%9F%9F | World 5]]</th><th colspan="1" rowspan="3" style="background-color: #dddcb1; width:.8%;"></th><th colspan="5" rowspan="1" style="width:10%;"> [[World_6:_%E4%B8%AD%E9%83%A8%E6%B5%B7%E5%9F%9F | World 6]]</th><th colspan="1" rowspan="3" style="background-color: #dddcb1; width:.8%;"></th><th colspan="1" rowspan="2" style="width:14%;"> Remarks</th></tr><tr><th style="width:2.5%;"> [[World_1:_%E9%8E%AE%E5%AE%88%E5%BA%9C%E6%B5%B7%E5%9F%9F#Drops | 1]]</th><th style="width:2.5%;"> [[World_1:_%E9%8E%AE%E5%AE%88%E5%BA%9C%E6%B5%B7%E5%9F%9F#Drops_2 | 2]]</th><th style="width:2.5%;"> [[World_1:_%E9%8E%AE%E5%AE%88%E5%BA%9C%E6%B5%B7%E5%9F%9F#Drops_3 | 3]]</th><th style="width:2.5%;"> [[World_1:_%E9%8E%AE%E5%AE%88%E5%BA%9C%E6%B5%B7%E5%9F%9F#Drops_4 | 4]]</th><th style="width:2.5%;"> [[World_1:_%E9%8E%AE%E5%AE%88%E5%BA%9C%E6%B5%B7%E5%9F%9F#Drops_5 | 5]]</th><th style="width:2.5%;"> [[World_2:_%E5%8D%97%E8%A5%BF%E8%AB%B8%E5%B3%B6%E6%B5%B7%E5%9F%9F#Drops | 1]]</th><th style="width:2.5%;"> [[World_2:_%E5%8D%97%E8%A5%BF%E8%AB%B8%E5%B3%B6%E6%B5%B7%E5%9F%9F#Drops_2 | 2]]</th><th style="width:2.5%;"> [[World_2:_%E5%8D%97%E8%A5%BF%E8%AB%B8%E5%B3%B6%E6%B5%B7%E5%9F%9F#Drops_3 | 3]]</th><th style="width:2.5%;"> [[World_2:_%E5%8D%97%E8%A5%BF%E8%AB%B8%E5%B3%B6%E6%B5%B7%E5%9F%9F#Drops_4 | 4]]</th><th style="width:2.5%;"> [[World_2:_%E5%8D%97%E8%A5%BF%E8%AB%B8%E5%B3%B6%E6%B5%B7%E5%9F%9F#Drops_5 | 5]]</th><th style="width:2.5%;"> [[World_3:_%E5%8C%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops | 1]]</th><th style="width:2.5%;"> [[World_3:_%E5%8C%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_2 | 2]]</th><th style="width:2.5%;"> [[World_3:_%E5%8C%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_3 | 3]]</th><th style="width:2.5%;"> [[World_3:_%E5%8C%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_4 | 4]]</th><th style="width:2.5%;"> [[World_3:_%E5%8C%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_5 | 5]]</th><th style="width:2.5%;"> [[World_4:_%E8%A5%BF%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops | 1]]</th><th style="width:2.5%;"> [[World_4:_%E8%A5%BF%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_2 | 2]]</th><th style="width:2.5%;"> [[World_4:_%E8%A5%BF%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_3 | 3]]</th><th style="width:2.5%;"> [[World_4:_%E8%A5%BF%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_4 | 4]]</th><th style="width:1%;"> -</th><th style="width:2.5%;"> [[World_5:_%E5%8D%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops | 1]]</th><th style="width:2.5%;"> [[World_5:_%E5%8D%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_2 | 2]]</th><th style="width:2.5%;"> [[World_5:_%E5%8D%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_3 | 3]]</th><th style="width:2.5%;"> [[World_5:_%E5%8D%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_4 | 4]]</th><th style="width:2.5%;"> [[World_5:_%E5%8D%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_5 | 5]]</th><th style="width:2.5%;"> [[World_6:_%E4%B8%AD%E9%83%A8%E6%B5%B7%E5%9F%9F#Drops | 1]]</th><th style="width:2.5%;"> [[World_6:_%E4%B8%AD%E9%83%A8%E6%B5%B7%E5%9F%9F#Drops_2 | 2]]</th><th style="width:1%;"> -</th><th style="width:1%;"> -</th><th style="width:1%;"> -</th></tr>'
| |
| local order = {"1","2","3","4","5"} | | local order = {"1","2","3","4","5"} |
| local worldOrder = {"World1", "World2", "World3", "World4", "World5", "World6"} | | local worldOrder = {"World1", "World2", "World3", "World4", "World5", "World6"} |
− | html = html .. "<tr><td>" .. tableInfo["No."] .. "</td>" | + | local html = "" |
| + | html = html .. "<tr><td>" .. tableInfo["ShipName"] .. "</td>" |
| html = html .. "<td>" .. tableInfo["Rarity"] .. "</td>" | | html = html .. "<td>" .. tableInfo["Rarity"] .. "</td>" |
− | html = html .. "<td>" .. tableInfo["ShipName"] .. "</td>" | + | html = html .. "<td>" .. tableInfo["No."] .. "</td>" |
| for i,world in pairs(worldOrder) do | | for i,world in pairs(worldOrder) do |
| for ii,map in pairs(order) do | | for ii,map in pairs(order) do |
Line 22: |
Line 20: |
| end | | end |
| html = html .. "<td>" .. tableInfo["Remarks"] .. "</td>" | | html = html .. "<td>" .. tableInfo["Remarks"] .. "</td>" |
− | html = html .. "</tr></table>" | + | html = html .. "</tr>" |
| return html | | return html |
| end | | end |
Line 5,348: |
Line 5,346: |
| ["3"] = "", | | ["3"] = "", |
| ["4"] = "", | | ["4"] = "", |
− | ["5"] = "X<ref>Can be found if you don't have Akashi yet.</ref>", | + | ["5"] = "X", |
| }, ["World3"] = { | | }, ["World3"] = { |
| ["1"] = "", | | ["1"] = "", |
Line 5,878: |
Line 5,876: |
| } | | } |
| } | | } |
− | | + | -- Lazy. Will modify later to be more like Infobox module |
− | local shipName = frame.args[1] | + | -- Please don't shoot me. I want to kill myself at how ugly this is, too. dw. |
− | return p.formatShipDropTable(dropList[shipName])
| + | local html = "<ol><li>Symbols<ul><li>X = Obtainable <b>only</b> in boss nodes</li><li>O = Obtainable in any node beside the boss node</li></ul></li><li>Unless specified, all ships are obtainable through crafting.<ul><li>Ships that only craftable through Large Ship Construction (LSC) will have notes specified (<i>LSC Crafting</i>)</li></ul></li></ol>" |
− | --return formatted | + | html = html .. '<table class="wikitable" style="text-align: center; width:100%;"><tr><th colspan="1" rowspan="2" style="width:10%;"> Ship Name</th><th colspan="1" rowspan="2" style="width:2%;"> Rarity</th><th colspan="1" rowspan="2" style="width:3%;"> No.</th><th colspan="1" rowspan="167" style="background-color: #dddcb1; width:.8%;"></th><th colspan="5" rowspan="1" style="width:12.5%;"> [[World_1:_%E9%8E%AE%E5%AE%88%E5%BA%9C%E6%B5%B7%E5%9F%9F | World 1]]</th><th colspan="1" rowspan="167" style="background-color: #dddcb1; width:.8%;"></th><th colspan="5" rowspan="1" style="width:12.5%;"> [[World_2:_%E5%8D%97%E8%A5%BF%E8%AB%B8%E5%B3%B6%E6%B5%B7%E5%9F%9F | World 2]]</th><th colspan="1" rowspan="167" style="background-color: #dddcb1; width:.8%;"></th><th colspan="5" rowspan="1" style="width:12.5%;"> [[World_3:_%E5%8C%97%E6%96%B9%E6%B5%B7%E5%9F%9F | World 3]]</th><th colspan="1" rowspan="167" style="background-color: #dddcb1; width:.8%;"></th><th colspan="5" rowspan="1" style="width:11%;"> [[World_4:_%E8%A5%BF%E6%96%B9%E6%B5%B7%E5%9F%9F | World 4]]</th><th colspan="1" rowspan="167" style="background-color: #dddcb1; width:.8%;"></th><th colspan="5" rowspan="1" style="width:12.5%;"> [[World_5:_%E5%8D%97%E6%96%B9%E6%B5%B7%E5%9F%9F | World 5]]</th><th colspan="1" rowspan="167" style="background-color: #dddcb1; width:.8%;"></th><th colspan="5" rowspan="1" style="width:10%;"> [[World_6:_%E4%B8%AD%E9%83%A8%E6%B5%B7%E5%9F%9F | World 6]]</th><th colspan="1" rowspan="167" style="background-color: #dddcb1; width:.8%;"></th><th colspan="1" rowspan="2" style="width:14%;"> Remarks</th></tr><tr><th style="width:2.5%;"> [[World_1:_%E9%8E%AE%E5%AE%88%E5%BA%9C%E6%B5%B7%E5%9F%9F#Drops | 1]]</th><th style="width:2.5%;"> [[World_1:_%E9%8E%AE%E5%AE%88%E5%BA%9C%E6%B5%B7%E5%9F%9F#Drops_2 | 2]]</th><th style="width:2.5%;"> [[World_1:_%E9%8E%AE%E5%AE%88%E5%BA%9C%E6%B5%B7%E5%9F%9F#Drops_3 | 3]]</th><th style="width:2.5%;"> [[World_1:_%E9%8E%AE%E5%AE%88%E5%BA%9C%E6%B5%B7%E5%9F%9F#Drops_4 | 4]]</th><th style="width:2.5%;"> [[World_1:_%E9%8E%AE%E5%AE%88%E5%BA%9C%E6%B5%B7%E5%9F%9F#Drops_5 | 5]]</th><th style="width:2.5%;"> [[World_2:_%E5%8D%97%E8%A5%BF%E8%AB%B8%E5%B3%B6%E6%B5%B7%E5%9F%9F#Drops | 1]]</th><th style="width:2.5%;"> [[World_2:_%E5%8D%97%E8%A5%BF%E8%AB%B8%E5%B3%B6%E6%B5%B7%E5%9F%9F#Drops_2 | 2]]</th><th style="width:2.5%;"> [[World_2:_%E5%8D%97%E8%A5%BF%E8%AB%B8%E5%B3%B6%E6%B5%B7%E5%9F%9F#Drops_3 | 3]]</th><th style="width:2.5%;"> [[World_2:_%E5%8D%97%E8%A5%BF%E8%AB%B8%E5%B3%B6%E6%B5%B7%E5%9F%9F#Drops_4 | 4]]</th><th style="width:2.5%;"> [[World_2:_%E5%8D%97%E8%A5%BF%E8%AB%B8%E5%B3%B6%E6%B5%B7%E5%9F%9F#Drops_5 | 5]]</th><th style="width:2.5%;"> [[World_3:_%E5%8C%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops | 1]]</th><th style="width:2.5%;"> [[World_3:_%E5%8C%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_2 | 2]]</th><th style="width:2.5%;"> [[World_3:_%E5%8C%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_3 | 3]]</th><th style="width:2.5%;"> [[World_3:_%E5%8C%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_4 | 4]]</th><th style="width:2.5%;"> [[World_3:_%E5%8C%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_5 | 5]]</th><th style="width:2.5%;"> [[World_4:_%E8%A5%BF%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops | 1]]</th><th style="width:2.5%;"> [[World_4:_%E8%A5%BF%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_2 | 2]]</th><th style="width:2.5%;"> [[World_4:_%E8%A5%BF%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_3 | 3]]</th><th style="width:2.5%;"> [[World_4:_%E8%A5%BF%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_4 | 4]]</th><th style="width:1%;"> -</th><th style="width:2.5%;"> [[World_5:_%E5%8D%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops | 1]]</th><th style="width:2.5%;"> [[World_5:_%E5%8D%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_2 | 2]]</th><th style="width:2.5%;"> [[World_5:_%E5%8D%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_3 | 3]]</th><th style="width:2.5%;"> [[World_5:_%E5%8D%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_4 | 4]]</th><th style="width:2.5%;"> [[World_5:_%E5%8D%97%E6%96%B9%E6%B5%B7%E5%9F%9F#Drops_5 | 5]]</th><th style="width:2.5%;"> [[World_6:_%E4%B8%AD%E9%83%A8%E6%B5%B7%E5%9F%9F#Drops | 1]]</th><th style="width:2.5%;"> [[World_6:_%E4%B8%AD%E9%83%A8%E6%B5%B7%E5%9F%9F#Drops_2 | 2]]</th><th style="width:1%;"> -</th><th style="width:1%;"> -</th><th style="width:1%;"> -</th></tr>' |
| + | if frame.args[1] ~= "all" then |
| + | for i,shipName in pairs(frame.args) do |
| + | html = html .. p.formatShipDropTable(dropList[shipName]) |
| + | end |
| + | end |
| + | if frame.args[1] == "all" then |
| + | local ordered_keys = {} |
| + | for k in pairs(dropList) do |
| + | table.insert(ordered_keys, k) |
| + | end |
| + | table.sort(ordered_keys) |
| + | for i = 1, #ordered_keys do |
| + | shipName = ordered_keys[i] |
| + | html = html .. p.formatShipDropTable(dropList[shipName]) |
| + | end |
| + | end |
| + | html = html .. "</table>" |
| + | return html |
| end | | end |
| | | |
| return p | | return p |