Module:Extracted: Difference between revisions

From Heroes 3 wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(20 intermediate revisions by the same user not shown)
Line 3: Line 3:
function p.extracted(frame)
function p.extracted(frame)
if frame.args['start'] then
if frame.args['start'] then
return frame.args['start']
return ''
end
end
if frame.args['end'] then
if frame.args['end'] then
return frame.args['end']
return [[
]] .. frame:expandTemplate{title = 'extracted'}
end
end
return '[[file:' .. frame.args[1] .. '|1px]]'
size = ''
if  mw.title.getCurrentTitle().text:find('Extracted/Sprites/BattleBackgrounds') then
size = '|200px'
elseif  mw.title.getCurrentTitle().text:find('Extracted/Sprites/Campaign') then
size = '|90px'
elseif  mw.title.getCurrentTitle().text:find('Extracted/Sprites/TownView') then
size = '|200px'
elseif  mw.title.getCurrentTitle().text:find('Extracted/UI/Back') then
size = '|x200px'
elseif  mw.title.getCurrentTitle().text:find('Extracted/UI/MainMenu') then
size = '|200px'
end
return '[[file:' .. frame.args[1] .. size .. ']]'
end
end


return p
return p

Latest revision as of 21:43, 11 January 2024

{{#invoke:extracted|extracted|filename.png}}


local p = {} --p stands for package

function p.extracted(frame)
	if frame.args['start'] then
		return ''
	end
	if frame.args['end'] then
		return [[
		
		]] .. frame:expandTemplate{title = 'extracted'}
	end
	size = ''
	if  mw.title.getCurrentTitle().text:find('Extracted/Sprites/BattleBackgrounds') then
		size = '|200px'
	elseif  mw.title.getCurrentTitle().text:find('Extracted/Sprites/Campaign') then
		size = '|90px'
	elseif  mw.title.getCurrentTitle().text:find('Extracted/Sprites/TownView') then
		size = '|200px'
	elseif  mw.title.getCurrentTitle().text:find('Extracted/UI/Back') then
		size = '|x200px'
	elseif  mw.title.getCurrentTitle().text:find('Extracted/UI/MainMenu') then
		size = '|200px'
	end
	return '[[file:' .. frame.args[1] .. size .. ']]'
end

return p