Changes

Reference support for image assets
Line 1: Line 1:  
local BaseData = require("Module:BaseData")
 
local BaseData = require("Module:BaseData")
 +
local Equipment
 
local EquipmentCompatibility --lazily loaded when equippable() is called
 
local EquipmentCompatibility --lazily loaded when equippable() is called
 
local Formatting = require('Module:Formatting')
 
local Formatting = require('Module:Formatting')
Line 8: Line 9:  
_mobile_hide_class = "hidden",
 
_mobile_hide_class = "hidden",
 
_display_none_css = {display = "none"},
 
_display_none_css = {display = "none"},
 +
_constructor_module = "Module:Equipment",
 
})
 
})
   Line 134: Line 136:  
if self._card then
 
if self._card then
 
return self._card
 
return self._card
 +
elseif self._card_reference then
 +
Equipment = Equipment or require(self._constructor_module)
 +
return Equipment(self._card_reference):card()
 
end
 
end
 
api_id = self:api_id()
 
api_id = self:api_id()
Line 145: Line 150:  
if self._fairy then
 
if self._fairy then
 
return self._fairy
 
return self._fairy
 +
elseif self._fairy_reference then
 +
Equipment = Equipment or require(self._constructor_module)
 +
return Equipment(self._fairy_reference):fairy()
 
end
 
end
 
api_id = self:api_id()
 
api_id = self:api_id()
Line 156: Line 164:  
if self._cg then
 
if self._cg then
 
return self._cg
 
return self._cg
 +
elseif self._cg_reference then
 +
Equipment = Equipment or require(self._constructor_module)
 +
return Equipment(self._cg_reference):cg()
 
end
 
end
 
api_id = self:api_id()
 
api_id = self:api_id()
Line 167: Line 178:  
if self._cg_fairy then
 
if self._cg_fairy then
 
return self._cg_fairy
 
return self._cg_fairy
 +
elseif self._cg_fairy_reference then
 +
Equipment = Equipment or require(self._constructor_module)
 +
return Equipment(self._cg_fairy_reference):cg_fairy()
 
end
 
end
 
api_id = self:api_id()
 
api_id = self:api_id()
Anonymous user