Line 32: |
Line 32: |
| _fighter_power = 0, | | _fighter_power = 0, |
| _hq_lvl = 0, | | _hq_lvl = 0, |
− | _route_taken = "" | + | _route_taken = {} |
| }) | | }) |
| | | |
Line 74: |
Line 74: |
| row = {row[3], row[4]} | | row = {row[3], row[4]} |
| return self:equips(row) | | return self:equips(row) |
− | end
| |
− |
| |
− | function NanaminFleet:get_routing()
| |
− | for index, item_key in ipairs(self._args) do
| |
− | if mw.ustring.find(item_key, '!route') then
| |
− | local split = mw.ustring.find(item_key, '=')
| |
− | local value = mw.ustring.sub(item_key, split + 1)
| |
− | return value
| |
− | end
| |
− | end
| |
| end | | end |
| | | |
Line 124: |
Line 114: |
| elseif mw.ustring.find(item_key, '!route') then | | elseif mw.ustring.find(item_key, '!route') then |
| local split = mw.ustring.find(item_key, '=') | | local split = mw.ustring.find(item_key, '=') |
− | self._args._route_taken = mw.ustring.sub(item_key, split + 1) | + | local route = mw.ustring.sub(item_key, split + 1) |
| + | while mw.ustring.find(route, '-') do |
| + | split = mw.ustring.find(route, '-') |
| + | table.insert(self._route_taken, mw.ustring.sub(route, 1, split - 1)) |
| + | route = mw.ustring.sub(route, split + 1) |
| + | end |
| + | table.insert(self._route_taken, route) |
| else | | else |
| if mw.ustring.find(item_key, '/') then | | if mw.ustring.find(item_key, '/') then |
Line 251: |
Line 247: |
| fighter_power = self._fighter_power | | fighter_power = self._fighter_power |
| }) | | }) |
− | local routing = self:get_routing()
| |
| table.insert(self._rows, self._row_starter) | | table.insert(self._rows, self._row_starter) |
| table.insert(self._rows, format{self._route_cell_template, | | table.insert(self._rows, format{self._route_cell_template, |
− | route_taken = self._args._route_taken | + | route_taken = table.concat(self._route_taken, '-') |
| }) | | }) |
| end | | end |