Line 1: |
Line 1: |
− | local Equipment = require('Module:Equipment') | + | local EquipmentAsset = require('Module:EquipmentAsset') |
| local Formatting = require('Module:Formatting') | | local Formatting = require('Module:Formatting') |
| | | |
− | local EquipmentCardKai = { | + | local EquipmentCardKai = EquipmentAsset() |
− | _card_size = "260x260px",
| |
− | }
| |
| | | |
− | function EquipmentCardKai:card(equipment, args) | + | function EquipmentCardKai:get_source(equip, as_item) |
| + | return equip:card(as_item) |
| + | end |
| + | |
| + | function EquipmentCardKai:get(equip, args, link) |
| if not args then | | if not args then |
− | args = equipment | + | args = equip |
− | equipment = args.equipment | + | equip = args.equipment or args.equip |
| + | link = args.link |
| end | | end |
− | return Formatting:format_image{equipment:card(), size = args.size or self._card_size, link = args.link, caption = args.caption} | + | if args.icon then |
− | end
| + | args[1] = equip:icon(args.item) |
− | | + | else |
− | function EquipmentCardKai:Card(args)
| + | args[1] = self:get_source(equip, args.item) |
− | local equipment = self:create_equipment(args)
| + | end |
− | return self:card(equipment, args)
| + | args.link = link |
− | end | + | return Formatting:format_image(args) |
− | | |
− | function EquipmentCardKai:create_equipment(args)
| |
− | return Equipment(args[1]) | |
| end | | end |
| | | |
| return EquipmentCardKai | | return EquipmentCardKai |