Line 1: |
Line 1: |
− | local format = require('Module:StringInterpolation').format
| |
− | local getArgs = require('Module:GetArgs')
| |
| local Formatting = require('Module:Formatting') | | local Formatting = require('Module:Formatting') |
− | local EnemyShipInfoKai = require('Module:EnemyShipInfoKai') | + | local ShipInfoKai = require('Module:ShipInfoKai') |
− | local ShipBattleCardKai = require('Module:ShipBattleCardKai')
| |
| | | |
− | local EnemyShipInfoMini = EnemyShipInfoKai{ | + | local EnemyShipInfoMini = ShipInfoKai{ |
| _template = [[{|class="typography-xl-optout ${table_class}" style="margin: auto; float: none; border: 1px solid darkgray; width: 160px;" | | _template = [[{|class="typography-xl-optout ${table_class}" style="margin: auto; float: none; border: 1px solid darkgray; width: 160px;" |
| |- | | |- |
Line 31: |
Line 28: |
| | colspan="4" style="text-align: center;" | ${slot_details} | | | colspan="4" style="text-align: center;" | ${slot_details} |
| |- | | |- |
− | | colspan="4" style="padding: 0px;" |<div style="background-color: lightskyblue; text-align: center; margin: 0px;" class="mw-customtoggle-extra">'''Extra'''</div> | + | | colspan="4" style="padding: 0px;" |<div style="background-color: lightskyblue; cursor: pointer; text-align: center; margin: 0px;" class="mw-customtoggle-extra">'''Extra'''</div> |
− | <div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-extra" style="padding: 2px;"> | + | <div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-extra" style="padding: 2px; font-size: 12px;"> |
− | <div style="display: ${opening_airstrike_display};">Airstrike (${opening_airstrike})</div>
| + | Some notes maybe |
− | <div>${day_battle}</div>
| |
− | <div style="display: ${artillery_spotting_display};">${artillery_spotting}</div>
| |
− | <div style="display: ${opening_torpedo_display};">Opening Salvo</div>
| |
− | <div style="display: ${closing_torpedo_display};">Torpedo (${closing_torpedo})</div>
| |
− | <div>ASW ${asw_attack}</div>
| |
− | <div>NB ${night_battle}</div>
| |
− | </div>
| |
| </div> | | </div> |
| |}]], | | |}]], |
Line 48: |
Line 38: |
| local link, text, section = self._ship:link() | | local link, text, section = self._ship:link() |
| self._vars.name = Formatting:format_link(link, text, section) | | self._vars.name = Formatting:format_link(link, text, section) |
| + | end |
| + | |
| + | function EnemyShipInfoMini:firepower() |
| + | self._vars.firepower = Formatting:format_stat(self._ship:firepower()) |
| + | end |
| + | |
| + | function EnemyShipInfoMini:armor() |
| + | self._vars.armor = Formatting:format_stat(self._ship:armor()) |
| + | end |
| + | |
| + | function EnemyShipInfoMini:torpedo() |
| + | self._vars.torpedo = Formatting:format_stat(self._ship:torpedo()) |
| + | end |
| + | |
| + | function EnemyShipInfoMini:aa() |
| + | self._vars.aa = Formatting:format_stat(self._ship:aa(), self._ship:aa()) |
| + | end |
| + | |
| + | function EnemyShipInfoMini:asw() |
| + | self._vars.asw = Formatting:format_stat(self._ship:asw(), self._ship:asw()) |
| end | | end |
| | | |
Line 75: |
Line 85: |
| end | | end |
| | | |
− | local collapsible_template = [[<div style="display:inline-block;">
| + | -- EnemyShipInfoMini.test = EnemyShipInfoMini:Infobox({"Destroyer I-Class"}) |
− | <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 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
| |
− | | |
− | EnemyShipInfoMini.test = EnemyShipInfoMini.EnemyInfoboxMini(nil, {"Destroyer I-Class"})
| |
| | | |
| return EnemyShipInfoMini | | return EnemyShipInfoMini |