Editing Module:Extra Effect
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
local lib = require('Module:Feature') | local lib = require('Module:Feature') | ||
local tt = require('Module:Tt') | local tt = require('Module:Tt/Draft') | ||
local Data = require('Module:Extra Effect/data') | local Data = require('Module:Extra Effect/data') | ||
function p.main(frame) | function p.main(frame) | ||
local args = require('Module:Arguments').getArgs(frame) | local args = require('Module:Arguments').getArgs(frame) | ||
return p._main(args | return p._main(args) | ||
end | end | ||
function p._main(args | function p._main(args) | ||
local displaytext = args[1] | local displaytext = args[1] | ||
local effect = lib.isNotEmpty(args[2]) and args[2] or displaytext | local effect = lib.isNotEmpty(args[2]) and args[2] or displaytext | ||
local entry | local entry | ||
| Line 18: | Line 18: | ||
if lib.trim(mw.ustring.lower(k)) == effect then | if lib.trim(mw.ustring.lower(k)) == effect then | ||
entry = v | entry = v | ||
break | break | ||
end | end | ||
| Line 25: | Line 24: | ||
if not entry then | if not entry then | ||
local cat = '[[Category:Pages Referencing Unknown Extra Effects]]' | local cat = '[[Category:Pages Referencing Unknown Extra Effects]]' | ||
return tostring(tt._main({ displaytext } | return tostring(tt._main({ displaytext })) .. cat | ||
end | end | ||
local tooltiptext = (lib.isNotEmpty(entry.header) and entry.header .. ': ' or '') .. entry.effect | |||
return tt._main({ displaytext, | return tt._main({ displaytext, tooltiptext }) | ||
end | end | ||
return p | return p | ||