- Welcome to the Kancolle Wiki!
- If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord
Difference between revisions of "Module:ShipCardListKai"
Jump to navigation
Jump to search
m (Testing of implementation with link.) |
m (Testing with links function.) |
||
Line 12: | Line 12: | ||
function ShipCardListKai:card(ship, link) | function ShipCardListKai:card(ship, link) | ||
local value | local value | ||
+ | if not args then | ||
+ | args = ship | ||
+ | ship = args.ship | ||
+ | end | ||
if ship == false then | if ship == false then | ||
value = Formatting:format_image{self._blank, size = self._size} | value = Formatting:format_image{self._blank, size = self._size} |
Revision as of 01:41, 15 September 2015
Documentation for this module may be created at Module:ShipCardListKai/doc
local CardList = require('Module:CardList')
local Formatting = require('Module:Formatting')
local Ship = require('Module:Ship')
local ShipCardKai = require('Module:ShipCardKai')
local ShipCardListKai = CardList{
_item_class = Ship,
_blank = "Empty ship slot.png",
_default_size = ShipCardKai._card_size,
}
function ShipCardListKai:card(ship, link)
local value
if not args then
args = ship
ship = args.ship
end
if ship == false then
value = Formatting:format_image{self._blank, size = self._size}
else
value = ShipCardKai:card{ship = ship, size = self._size, link = ship:link(), caption = ship:name()}
end
return {values = {value = value}, bg_color = self._transparent, text_align = self._center_align}
end
return ShipCardListKai