Mobius Final Fantasy Wiki
(simplifying module as icon only.)
mNo edit summary
Line 40: Line 40:
 
icon = "None Icon.png"
 
icon = "None Icon.png"
 
name = "[NONE]"
 
name = "[NONE]"
  +
else
  +
return ""
 
end
 
end
 
local fmt = "[[File:%s|link=|%spx|%s]]"
 
local fmt = "[[File:%s|link=|%spx|%s]]"

Revision as of 13:54, 1 June 2018


local p = {}
local getArgs = require("Module:Arguments").getArgs

function p.main( frame )
	local args = getArgs(frame, {
		wrappers = "Template:Orb"
	})
	return p._main(args)
end
function p._main( args )
	local element = lower(args[1] or "")
	local size = tonumber(args.size) or 20
	local icon, name
	
	if element == "fire" then
		icon = "Fire Icon.png"
		name = "[FIRE]"
	elseif element == "water" then
		icon = "Water Icon.png"
		name = "[WATER]"
	elseif element == "wind" then
		icon = "Wind Icon.png"
		name = "[WIND]"
	elseif element == "earth" then
		icon = "Earth Icon.png"
		name = "[EARTH]"
	elseif element == "light" then
		icon = "Light Icon.png"
		name = "[LIGHT]"
	elseif element == "dark" then
		icon = "Dark Icon.png"
		name = "[DARK]"
	elseif element == "restoration" or element == "life" then
		icon = "Life Icon.png"
		name = "[LIFE]"
	elseif element == "prismatic" then
		icon = "Prismatic Icon.png"
		name = "[PRISMATIC]"
	elseif element == "none" then
		icon = "None Icon.png"
		name = "[NONE]"
	else
		return ""
	end
	local fmt = "[[File:%s|link=|%spx|%s]]"
	return string.format(fmt, icon, size, name)
end

return p