• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
Add size arg to format_image()
Line 1: Line 1:  
local BaseData = {
 
local BaseData = {
 
_image_template = "[[File:%s]]",
 
_image_template = "[[File:%s]]",
 +
_image_sized_template = "[[File:%s|%s]]",
 
_no_image = "Catbomb.png|300px",
 
_no_image = "Catbomb.png|300px",
 +
_no_image_size = "300px",
 
_simple_link = "[[%s]]",
 
_simple_link = "[[%s]]",
 
_aliased_link = "[[%s|%s]]",
 
_aliased_link = "[[%s|%s]]",
Line 39: Line 41:  
})
 
})
   −
function BaseData:format_image(name, raw)
+
function BaseData:format_image(name, size, raw)
 
if raw then
 
if raw then
 
return name
 
return name
 
elseif name == nil then
 
elseif name == nil then
return mw.ustring.format(self._image_template, self._no_image)
+
return mw.ustring.format(self._image_sized_template, self._no_image, self._no_image_size)
 
else
 
else
return mw.ustring.format(self._image_template, name)
+
if size then
 +
return mw.ustring.format(self._image_sized_template, name, size)
 +
else
 +
return mw.ustring.format(self._image_template, name)
 +
end
 
end
 
end
 
end
 
end
Anonymous user

Navigation menu