- Welcome to the Kancolle Wiki!
- If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord
Changes
Jump to navigation
Jump to search
Line 58:
Line 58:
− +
− +
Line 80:
Line 80:
− +
+
+
+
+
+
+
+
+
+
+
− +
− +
Line 113:
Line 123:
− +
Line 128:
Line 138:
− +
+
+
+
+
+
+
+
+
+
+
Support disabling link at various levels
}
}
function ShipCardKai:card(ship, args)
function ShipCardKai:card(ship, args, link)
if not args then
if not args then
args = ship
args = ship
ship = args.ship
ship = args.ship
end
end
local image = Formatting:format_image{args.damaged and ship:card_damaged() or ship:card(), size = args.size or self._card_size, link = args.link or ship:link(), caption = args.caption}
local image = Formatting:format_image{args.damaged and ship:card_damaged() or ship:card(), size = args.size or self._card_size, link = link, caption = args.caption}
if args.layers or args.grayscale then
if args.layers or args.grayscale then
local stack = self:_create_stack(image, args.grayscale)
local stack = self:_create_stack(image, args.grayscale)
function ShipCardKai:Card(args)
function ShipCardKai:Card(args)
local ship = self:create_ship(args)
local ship = self:create_ship(args)
return self:card(ship, args)
if args.link then
if args.link == "nil" then
return self:card(ship, args, nil)
elseif args.link == "false" then
return self:card(ship, args, false)
else
return self:card(ship, args, args.link)
end
else
return self:card(ship, args, ship:link())
end
end
end
function ShipCardKai:battle_card(ship, args)
function ShipCardKai:battle_card(ship, args, link)
if not args then
if not args then
args = ship
args = ship
ship = args.ship
ship = args.ship
end
end
local image = Formatting:format_image{args.damaged and ship:battle_card_damaged() or ship:battle_card(), size = args.size or self._battle_card_size, link = args.link or ship:link(), caption = args.caption}
local image = Formatting:format_image{args.damaged and ship:battle_card_damaged() or ship:battle_card(), size = args.size or self._battle_card_size, link = link, caption = args.caption}
local ship_layers = ship:battle_card_layers()
local ship_layers = ship:battle_card_layers()
if ship_layers or args.flagship or args.layers or args.grayscale then
if ship_layers or args.flagship or args.layers or args.grayscale then
function ShipCardKai:_add_layer(stack, layer, ship, args)
function ShipCardKai:_add_layer(stack, layer, ship, args)
stack:node(mw.html.create('span'):addClass('image-layer'):css(self._image_layer_style):css(layer.style):wikitext(Formatting:format_image{layer.image, caption = layer.caption or args.caption, size = layer.size, link = args.link or ship:link()}))
stack:node(mw.html.create('span'):addClass('image-layer'):css(self._image_layer_style):css(layer.style):wikitext(Formatting:format_image{layer.image, caption = layer.caption or args.caption, size = layer.size, link = args.link}))
end
end
function ShipCardKai:BattleCard(args)
function ShipCardKai:BattleCard(args)
local ship = self:create_ship(args)
local ship = self:create_ship(args)
return self:battle_card(ship, args)
if args.link then
if args.link == "nil" then
return self:battle_card(ship, args, nil)
elseif args.link == "false" then
return self:battle_card(ship, args, false)
else
return self:card(ship, args, args.link)
end
else
return self:battle_card(ship, args, ship:link())
end
end
end