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

From Kancolle Wiki
Jump to navigation Jump to search
com>Ckwng
m
 
(11 intermediate revisions by 3 users not shown)
Line 6: Line 6:
 
local EquipmentCardListKai = CardList{
 
local EquipmentCardListKai = CardList{
 
_item_class = Equipment,
 
_item_class = Equipment,
_blank = "Empty equipment slot.png",
+
_blank = "Empty Equipment Card.png",
 
_default_size = EquipmentCardKai._card_size,
 
_default_size = EquipmentCardKai._card_size,
 +
_column_count = 5,
 +
_row_starter = nil,
 +
-- Seems like lua inheritance is fake? _row_starter = nil here doesn't penetrate thought
 +
-- EquipmentCardListKai -> CardList -> BaseTable chain, since CardList has _row_starter = "",
 +
-- thus we use _disable_row_starter hack here.
 +
_disable_row_starter = true,
 
}
 
}
 +
 +
function EquipmentCardListKai:process_item_key(item_key)
 +
return item_key
 +
end
  
 
function EquipmentCardListKai:card(equipment)
 
function EquipmentCardListKai:card(equipment)
Line 15: Line 25:
 
value = Formatting:format_image{self._blank, size = self._size}
 
value = Formatting:format_image{self._blank, size = self._size}
 
else
 
else
value = EquipmentCardKai:card{equipment = equipment, size = self._size, link = equipment:link(), caption = equipment:name()}
+
value = EquipmentCardKai:get{equipment = equipment, size = self._size, link = equipment:link(), caption = equipment:name()}
 
end
 
end
 
return {values = {value = value}, bg_color = self._transparent, text_align = self._center_align}
 
return {values = {value = value}, bg_color = self._transparent, text_align = self._center_align}

Latest revision as of 08:42, 17 October 2021

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

local CardList = require('Module:CardList')
local Equipment = require('Module:Equipment')
local EquipmentCardKai = require('Module:EquipmentCardKai')
local Formatting = require('Module:Formatting')

local EquipmentCardListKai = CardList{
	_item_class = Equipment,
	_blank = "Empty Equipment Card.png",
	_default_size = EquipmentCardKai._card_size,
	_column_count = 5,
	_row_starter = nil,
	-- Seems like lua inheritance is fake? _row_starter = nil here doesn't penetrate thought
	-- EquipmentCardListKai -> CardList -> BaseTable chain, since CardList has _row_starter = "",
	-- thus we use _disable_row_starter hack here.
	_disable_row_starter = true,
}

function EquipmentCardListKai:process_item_key(item_key)
	return item_key
end

function EquipmentCardListKai:card(equipment)
	local value
	if equipment == false then
		value = Formatting:format_image{self._blank, size = self._size}
	else
		value = EquipmentCardKai:get{equipment = equipment, size = self._size, link = equipment:link(), caption = equipment:name()}
	end
	return {values = {value = value}, bg_color = self._transparent, text_align = self._center_align}
end

return EquipmentCardListKai