Difference between revisions of "Module:EnemyShipOverview"
com>IloveSuiseiseki |
m (3 revisions imported) |
||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
local getArgs = require('Module:GetArgs') | local getArgs = require('Module:GetArgs') | ||
− | local format = require('Module: | + | local format = require('Module:Core').format |
function _prepareShipBattleCardKai() | function _prepareShipBattleCardKai() |
Latest revision as of 12:41, 12 May 2021
Documentation for this module may be created at Module:EnemyShipOverview/doc
local EnemyShipOverview = {}
local ShipBattleCardKai = false
local EnemyShipInfoMini = false
local getArgs = require('Module:GetArgs')
local format = require('Module:Core').format
function _prepareShipBattleCardKai()
if not ShipBattleCardKai then
ShipBattleCardKai = require('Module:ShipBattleCardKai')
end
end
function _prepareEnemyShipInfoMini()
if not EnemyShipInfoMini then
EnemyShipInfoMini = require('Module:EnemyShipInfoMini')
end
end
local collapsible_template = [[<div style="display:inline-block;">
<div class="mw-customtoggle-${toggle_id}">
{|class="wikitable" style="cursor: pointer; margin: auto; border: 1px solid darkgray;"
| ${card_image}
|}
</div>
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-${toggle_id}">
${table}
</div>
</div>]]
function EnemyShipOverview.EnemyInfoboxMini(frame)
local args = getArgs{frame = frame:getParent()}
args.link = "nil"
_prepareShipBattleCardKai()
_prepareEnemyShipInfoMini()
return format{
collapsible_template,
toggle_id = args.id,
card_image = ShipBattleCardKai:Asset(args),
table = EnemyShipInfoMini:Infobox(args),
}
end
return EnemyShipOverview