Line 1: |
Line 1: |
| local BaseTable = require('Module:BaseTable') | | local BaseTable = require('Module:BaseTable') |
| local Ship = require('Module:Ship') | | local Ship = require('Module:Ship') |
| + | local ShipBattleCardKai = require('Module:ShipBattleCardKai') |
| local ShipCardKai = require('Module:ShipCardKai') | | local ShipCardKai = require('Module:ShipCardKai') |
| local Equipment = require('Module:Equipment') | | local Equipment = require('Module:Equipment') |
| local Formatting = require('Module:Formatting') | | local Formatting = require('Module:Formatting') |
− | local format = require('Module:StringInterpolation').format | + | local format = require('Module:Core').format |
| | | |
| local NanaminFleet = BaseTable({ | | local NanaminFleet = BaseTable({ |
Line 60: |
Line 61: |
| value = Formatting:format_image{self._blank, size = self._size} | | value = Formatting:format_image{self._blank, size = self._size} |
| else | | else |
− | value = ShipCardKai:card{ship = row[1], size = self._size, link = row[1]:link(), caption = row[1]:name()} | + | value = ShipCardKai:get{ship = row[1], size = self._size, link = row[1]:link(), caption = row[1]:name()} |
| end | | end |
| return {values = {ship_card = value}, bg_color = self._transparent, text_align = self._center_align} | | return {values = {ship_card = value}, bg_color = self._transparent, text_align = self._center_align} |
Line 207: |
Line 208: |
| if value then | | if value then |
| row_values[column] = value | | row_values[column] = value |
− | row_values[column].rowspan = item.class ~= nil and 4 or 1
| |
− | row_values[column].colspan = 1
| |
| end | | end |
| end | | end |
Line 218: |
Line 217: |
| function NanaminFleet:build_rows() | | function NanaminFleet:build_rows() |
| for index, row_values in ipairs(self._data_rows) do | | for index, row_values in ipairs(self._data_rows) do |
− | if row_values ~= "break" and row_values ~= "extra" then | + | if row_values ~= "break" then |
| table.insert(self._rows, self._row_starter) | | table.insert(self._rows, self._row_starter) |
| if row_values == "header" then | | if row_values == "header" then |
Line 228: |
Line 227: |
| end | | end |
| end | | end |
− | else
| |
− | table.insert(self._rows,
| |
− | format{self._cell,
| |
− | colspan = #self._columns, rowspan = 1,
| |
− | text_align = self._args[self._custom_row_prefix .. row_values .. self._text_align_suffix] or self._start_align,
| |
− | bg_color = self._args[self._custom_row_prefix .. row_values .. self._bg_color_suffix] or self._transparent,
| |
− | values = {
| |
− | value = self._args[self._custom_row_prefix .. row_values .. self._content_suffix] or "",
| |
− | },
| |
− | }
| |
− | )
| |
| end | | end |
| end | | end |
Line 269: |
Line 257: |
| local split = mw.ustring.find(drops_str, '/') | | local split = mw.ustring.find(drops_str, '/') |
| local ship = Ship(mw.ustring.sub(drops_str, 1, split - 1), "") | | local ship = Ship(mw.ustring.sub(drops_str, 1, split - 1), "") |
− | local battle_card = ShipCardKai:battle_card{ship = ship, link = ship:link(), caption = ship:name()} | + | local battle_card = ShipBattleCardKai:get{ship = ship, link = ship:link(), caption = ship:name()} |
| table.insert(drops, battle_card) | | table.insert(drops, battle_card) |
| drops_str = mw.ustring.sub(drops_str, split + 1) | | drops_str = mw.ustring.sub(drops_str, split + 1) |
| end | | end |
| local ship = Ship(drops_str, "") | | local ship = Ship(drops_str, "") |
− | local battle_card = ShipCardKai:battle_card{ship = ship, link = ship:link(), caption = ship:name()} | + | local battle_card = ShipBattleCardKai:get{ship = ship, link = ship:link(), caption = ship:name()} |
| table.insert(drops, battle_card) | | table.insert(drops, battle_card) |
| | | |