Line 69: |
Line 69: |
| local entry = {} | | local entry = {} |
| for index, item in ipairs(args) do | | for index, item in ipairs(args) do |
− | if item == "-" and #entry > 0 then | + | if mw.ustring.sub(item, 1, 1) == "#" then |
| + | table.insert(self._items, mw.ustring.sub(item, 2)) |
| + | elseif item == "-" and #entry > 0 then |
| self:process_los(entry) | | self:process_los(entry) |
| table.insert(self._items, entry) | | table.insert(self._items, entry) |
Line 136: |
Line 138: |
| equip_link = equip_link, | | equip_link = equip_link, |
| }) | | }) |
| + | end |
| + | |
| + | function NanaminFleetKai:insert_extra(content) |
| + | table.insert(self._rows, self._row_starter) |
| + | table.insert(self._rows, format{self._added_cell_template, content = content, bg_color = self._extra_cells_bg }) |
| end | | end |
| | | |
| function NanaminFleetKai:build_table() | | function NanaminFleetKai:build_table() |
| for i = 1, #self._items, 2 do | | for i = 1, #self._items, 2 do |
| + | if type(self.items[i]) == "string" then |
| + | self:insert_extra(self._items[i]) |
| + | i = i + 1 |
| + | end |
| local ship1 = Ship(self._items[i][1], self._items[i][2]) | | local ship1 = Ship(self._items[i][1], self._items[i][2]) |
| self:insert_ship_row(ship1) | | self:insert_ship_row(ship1) |
| self:insert_equip_row(ship1, self._items[i], 1) | | self:insert_equip_row(ship1, self._items[i], 1) |
| | | |
| + | if type(self.items[i + 1]) == "string" then |
| + | self:insert_extra(self._items[i]) |
| + | i = i + 1 |
| + | end |
| local ship2 | | local ship2 |
| if self._items[i + 1] then | | if self._items[i + 1] then |
Line 165: |
Line 180: |
| table.insert(self._rows, self._row_starter) | | table.insert(self._rows, self._row_starter) |
| end | | end |
− | end
| |
− |
| |
− | function NanaminFleetKai:insert_extra(content)
| |
− | table.insert(self._rows, self._row_starter)
| |
− | table.insert(self._rows, format{self._added_cell_template, content = content, bg_color = self._extra_cells_bg })
| |
| end | | end |
| | | |