Line 1: |
Line 1: |
− | local CardList = require('Module:CardList') | + | --Module:ShipList |
− | local Formatting = require('Module:Formatting') | + | local EliteShipsKai = false |
− | local Ship = require('Module:Ship') | + | local ShipBattleCardListKai = false |
− | local ShipCardKai = require('Module:ShipCardKai') | + | local ShipCardListKai = false |
| + | local ShipListKai = false |
| + | local ShipModernizationListKai = false |
| + | local ShipRemodelListKai = false |
| | | |
− | local ShipCardListKai = CardList{ | + | local getArgs = require('Module:GetArgs') |
− | _item_class = Ship,
| |
− | _blank = "Empty ship slot.png",
| |
− | _default_size = ShipCardKai._card_size,
| |
− | _column_count = 5,
| |
− | }
| |
| | | |
− | function ShipCardListKai:card(ship) | + | local ShipList = {} |
− | local value | + | |
− | if ship == false then | + | function ShipList.CardList(frame) |
− | value = Formatting:format_image{self._blank, size = self._size} | + | local args = getArgs{frame = frame:getParent()} |
− | else | + | _prepareShipCardListKai() |
− | value = ShipCardKai:get{ship = ship, size = self._size, link = ship:link(), caption = ship:name()} | + | return ShipCardListKai:Table(args) |
| + | end |
| + | |
| + | function _prepareShipCardListKai() |
| + | if not ShipCardListKai then |
| + | ShipCardListKai = require('Module:Sandbox/Chocolatecravinghobo/2') |
| + | end |
| + | end |
| + | |
| + | function ShipList.BattleCardList(frame) |
| + | local args = getArgs{frame = frame:getParent()} |
| + | _prepareShipBattleCardListKai() |
| + | return ShipBattleCardListKai:Table(args) |
| + | end |
| + | |
| + | function _prepareShipBattleCardListKai() |
| + | if not ShipBattleCardListKai then |
| + | ShipBattleCardListKai = require('Module:ShipBattleCardListKai') |
| + | end |
| + | end |
| + | |
| + | function ShipList.ShipList(frame) |
| + | local args = getArgs{frame = frame:getParent()} |
| + | _prepareShipListKai() |
| + | return ShipListKai:Table(args) |
| + | end |
| + | |
| + | function _prepareShipListKai() |
| + | if not ShipListKai then |
| + | ShipListKai = require('Module:ShipListKai') |
| + | end |
| + | end |
| + | |
| + | function ShipList.ShipRemodelList(frame) |
| + | local args = getArgs{frame = frame:getParent()} |
| + | _prepareShipRemodelListKai() |
| + | return ShipRemodelListKai:Table(args) |
| + | end |
| + | |
| + | function _prepareShipRemodelListKai() |
| + | if not ShipRemodelListKai then |
| + | ShipRemodelListKai = require('Module:ShipRemodelListKai') |
| + | end |
| + | end |
| + | |
| + | function ShipList.ShipModernizationList(frame) |
| + | local args = getArgs{frame = frame:getParent()} |
| + | _prepareShipModernizationListKai() |
| + | return ShipModernizationListKai:Table(args) |
| + | end |
| + | |
| + | function _prepareShipModernizationListKai() |
| + | if not ShipModernizationListKai then |
| + | ShipModernizationListKai = require('Module:ShipModernizationListKai') |
| + | end |
| + | end |
| + | |
| + | function ShipList.EliteShips(frame) |
| + | local args = getArgs{frame = frame:getParent()} |
| + | _prepareEliteShipsKai() |
| + | return EliteShipsKai:Table(args) |
| + | end |
| + | |
| + | function _prepareEliteShipsKai() |
| + | if not EliteShipsKai then |
| + | EliteShipsKai = require('Module:EliteShipsKai') |
| end | | end |
− | return {values = {value = value}, bg_color = self._transparent, text_align = self._center_align}
| |
| end | | end |
| | | |
− | return ShipCardListKai | + | return ShipList |