- 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:EnemyShipInfoMini"
Jump to navigation
Jump to search
(Created page with "local format = require('Module:StringInterpolation').format local getArgs = require('Module:GetArgs') local EnemyShipInfoKai = require('Module:EnemyShipInfoKai') local ShipBat...") |
m |
||
Line 45: | Line 45: | ||
function EnemyShipInfoMini.EnemyInfoboxMini(frame, args) | function EnemyShipInfoMini.EnemyInfoboxMini(frame, args) | ||
local args = args or getArgs{frame = frame:getParent()} | local args = args or getArgs{frame = frame:getParent()} | ||
− | if args. | + | if args.id then |
args.link = "nil" | args.link = "nil" | ||
return format{ | return format{ | ||
collapsible_template, | collapsible_template, | ||
− | toggle_id = args. | + | toggle_id = args.id, |
card_image = ShipBattleCardKai:Asset(args), | card_image = ShipBattleCardKai:Asset(args), | ||
table = EnemyShipInfoMini:Infobox(args), | table = EnemyShipInfoMini:Infobox(args), |
Revision as of 21:24, 5 February 2016
Documentation for this module may be created at Module:EnemyShipInfoMini/doc
local format = require('Module:StringInterpolation').format
local getArgs = require('Module:GetArgs')
local EnemyShipInfoKai = require('Module:EnemyShipInfoKai')
local ShipBattleCardKai = require('Module:ShipBattleCardKai')
local EnemyShipInfoMini = EnemyShipInfoKai{
_template = [[{|class="typography-xl-optout wikitable" style="margin: auto; width: 160px;"
|-
! colspan="4" style="background-color: ${top_bg_color}; ${top_extra_style}" | ${name}<br />${japanese_name}
|-
! colspan="4" style="background-color: LightSkyBlue;" | Statistics
|- style="background-color: whitesmoke;"
| style="text-align: center;" | ${icons.hp}
| style="text-align: center;" | ${hp}
| style="text-align: center;" | ${icons.armor}
| style="text-align: center;" | ${armor}
|- style="background-color: whitesmoke;"
| style="text-align: center;" | ${icons.firepower}
| style="text-align: center;" | ${firepower}
| style="text-align: center;" | ${icons.torpedo}
| style="text-align: center;" | ${torpedo}
|- style="background-color: whitesmoke;"
| style="text-align: center;" | ${icons.asw}
| style="text-align: center;" | ${asw}
| style="text-align: center;" | ${icons.aa}
| style="text-align: center;" | ${aa}
|-
! colspan="4" style="background-color: LightSkyBlue;" | '''Equipment'''
|- style="background-color: whitesmoke;"
| colspan="4" style="text-align: center;" |
|}]],
}
local collapsible_template = [[<div style="display:inline-block;">
<div class="mw-customtoggle-${toggle_id}">
{|class="wikitable" style="cursor: pointer; margin: auto;"
| ${card_image}
|}
</div>
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-${toggle_id}">
${table}
</div>
</div>]]
function EnemyShipInfoMini.EnemyInfoboxMini(frame, args)
local args = args or getArgs{frame = frame:getParent()}
if args.id then
args.link = "nil"
return format{
collapsible_template,
toggle_id = args.id,
card_image = ShipBattleCardKai:Asset(args),
table = EnemyShipInfoMini:Infobox(args),
}
else
return EnemyShipInfoMini:Infobox(args)
end
end
return EnemyShipInfoMini