- 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:ShipCardKai"
Jump to navigation
Jump to search
com>Ckwng |
com>Ckwng |
||
Line 7: | Line 7: | ||
} | } | ||
− | function ShipCardKai: | + | function ShipCardKai:card(ship, args) |
+ | if not args then | ||
+ | args = ship | ||
+ | ship = args.ship | ||
+ | end | ||
return Formatting:format_image{ship:card(), size = args.size or self._card_size, link = args.link, caption = args.caption} | return Formatting:format_image{ship:card(), size = args.size or self._card_size, link = args.link, caption = args.caption} | ||
end | end | ||
Line 13: | Line 17: | ||
function ShipCardKai:Card(args) | function ShipCardKai:Card(args) | ||
local ship = self:create_ship(args) | local ship = self:create_ship(args) | ||
− | return self: | + | return self:card(ship, args) |
end | end | ||
− | function ShipCardKai: | + | function ShipCardKai:battle_card(ship, args) |
+ | if not args then | ||
+ | args = ship | ||
+ | ship = args.ship | ||
+ | end | ||
return Formatting:format_image{ship:battle_card(), size = args.size or self._battle_card_size, link = args.link, caption = args.caption} | return Formatting:format_image{ship:battle_card(), size = args.size or self._battle_card_size, link = args.link, caption = args.caption} | ||
end | end | ||
Line 22: | Line 30: | ||
function ShipCardKai:BattleCard(args) | function ShipCardKai:BattleCard(args) | ||
local ship = self:create_ship(args) | local ship = self:create_ship(args) | ||
− | return self: | + | return self:battle_card(ship, args) |
end | end | ||
Revision as of 18:12, 6 April 2015
Documentation for this module may be created at Module:ShipCardKai/doc
local Ship = require('Module:Ship')
local Formatting = require('Module:Formatting')
local ShipCardKai = {
_card_size = "218x300px",
_battle_card_size = "160x40px",
}
function ShipCardKai:card(ship, args)
if not args then
args = ship
ship = args.ship
end
return Formatting:format_image{ship:card(), size = args.size or self._card_size, link = args.link, caption = args.caption}
end
function ShipCardKai:Card(args)
local ship = self:create_ship(args)
return self:card(ship, args)
end
function ShipCardKai:battle_card(ship, args)
if not args then
args = ship
ship = args.ship
end
return Formatting:format_image{ship:battle_card(), size = args.size or self._battle_card_size, link = args.link, caption = args.caption}
end
function ShipCardKai:BattleCard(args)
local ship = self:create_ship(args)
return self:battle_card(ship, args)
end
function ShipCardKai:create_ship(args)
return Ship(args.name, args.model)
end
return ShipCardKai