• 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:EquipmentInfo"

From Kancolle Wiki
Jump to navigation Jump to search
com>Ckwng
(Add subst-able entry point)
m
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
local EquipmentCardKai = false
 +
local EquipmentCategoriesKai = false
 +
local EquipmentGraphicKai = false
 +
local EquipmentInfoKai = false
 +
local EnemyEquipmentInfoKai = false
 +
local getArgs = require('Module:GetArgs')
 +
 
local EquipmentInfo = {}
 
local EquipmentInfo = {}
local EquipmentInfoKai = require('Module:EquipmentInfoKai')
 
local getArgs = require('Module:GetArgs')
 
  
 
function EquipmentInfo.Infobox(frame)
 
function EquipmentInfo.Infobox(frame)
 +
EquipmentInfoKai = EquipmentInfoKai or require('Module:EquipmentInfoKai')
 +
return EquipmentInfoKai:Infobox(frame.args.pagename and {frame.args.pagename} or getArgs{frame = frame:getParent()})
 +
end
 +
 +
function EquipmentInfo.Card(frame)
 +
local args = getArgs{frame = frame:getParent()}
 +
_prepareEquipmentCardKai()
 +
return EquipmentCardKai:Asset(args)
 +
end
 +
 +
function _prepareEquipmentCardKai()
 +
if not EquipmentCardKai then
 +
EquipmentCardKai = require('Module:EquipmentCardKai')
 +
end
 +
end
 +
 +
function EquipmentInfo.Graphic(frame)
 +
local args = getArgs{frame = frame:getParent()}
 +
_prepareEquipmentGraphicKai()
 +
return EquipmentGraphicKai:Asset(args)
 +
end
 +
 +
function _prepareEquipmentGraphicKai()
 +
if not EquipmentGraphicKai then
 +
EquipmentGraphicKai = require('Module:EquipmentGraphicKai')
 +
end
 +
end
 +
 +
function EquipmentInfo.Categories(frame)
 +
local args = getArgs{frame = frame:getParent()}
 +
_prepareEquipmentCategoriesKai()
 +
return EquipmentCategoriesKai:Categories(args)
 +
end
 +
 +
function _prepareEquipmentCategoriesKai()
 +
if not EquipmentCategoriesKai then
 +
EquipmentCategoriesKai = require('Module:EquipmentCategoriesKai')
 +
end
 +
end
 +
 +
function EquipmentInfo.EnemyInfobox(frame)
 
local args = getArgs{frame = frame:getParent()}
 
local args = getArgs{frame = frame:getParent()}
return EquipmentInfoKai:Infobox(args["name"])
+
_prepareEnemyEquipmentInfoKai()
 +
return EnemyEquipmentInfoKai:Infobox(args)
 
end
 
end
  
function EquipmentInfo._Infobox(frame)
+
function _prepareEnemyEquipmentInfoKai()
local args = getArgs{frame = frame}
+
if not EnemyEquipmentInfoKai then
return EquipmentInfoKai:Infobox(args["name"])
+
EnemyEquipmentInfoKai = require('Module:EnemyEquipmentInfoKai')
 +
end
 
end
 
end
  
 
return EquipmentInfo
 
return EquipmentInfo

Latest revision as of 12:02, 8 September 2022

Documentation for this module may be created at Module:EquipmentInfo/doc

local EquipmentCardKai = false
local EquipmentCategoriesKai = false
local EquipmentGraphicKai = false
local EquipmentInfoKai = false
local EnemyEquipmentInfoKai = false
local getArgs = require('Module:GetArgs')

local EquipmentInfo = {}

function EquipmentInfo.Infobox(frame)
	EquipmentInfoKai = EquipmentInfoKai or require('Module:EquipmentInfoKai')
	return EquipmentInfoKai:Infobox(frame.args.pagename and {frame.args.pagename} or getArgs{frame = frame:getParent()})
end

function EquipmentInfo.Card(frame)
	local args = getArgs{frame = frame:getParent()}
	_prepareEquipmentCardKai()
	return EquipmentCardKai:Asset(args)
end

function _prepareEquipmentCardKai()
	if not EquipmentCardKai then
		EquipmentCardKai = require('Module:EquipmentCardKai')
	end
end

function EquipmentInfo.Graphic(frame)
	local args = getArgs{frame = frame:getParent()}
	_prepareEquipmentGraphicKai()
	return EquipmentGraphicKai:Asset(args)
end

function _prepareEquipmentGraphicKai()
	if not EquipmentGraphicKai then
		EquipmentGraphicKai = require('Module:EquipmentGraphicKai')
	end
end

function EquipmentInfo.Categories(frame)
	local args = getArgs{frame = frame:getParent()}
	_prepareEquipmentCategoriesKai()
	return EquipmentCategoriesKai:Categories(args)
end

function _prepareEquipmentCategoriesKai()
	if not EquipmentCategoriesKai then
		EquipmentCategoriesKai = require('Module:EquipmentCategoriesKai')
	end
end

function EquipmentInfo.EnemyInfobox(frame)
	local args = getArgs{frame = frame:getParent()}
	_prepareEnemyEquipmentInfoKai()
	return EnemyEquipmentInfoKai:Infobox(args)
end

function _prepareEnemyEquipmentInfoKai()
	if not EnemyEquipmentInfoKai then
		EnemyEquipmentInfoKai = require('Module:EnemyEquipmentInfoKai')
	end
end

return EquipmentInfo