Module:Extra Effect: Difference between revisions
No edit summary |
this is kinda a wip cause tt is still Like That |
||
| Line 10: | Line 10: | ||
function p._main(args) | function p._main(args) | ||
local displaytext = args[1] | |||
local effect = lib.isNotEmpty(args[2]) and args[2] or displaytext | |||
local entry | |||
local effect = lib.trim(mw.ustring.lower(effect)) | |||
for k, v in pairs(Data) do | |||
if lib.trim(mw.ustring.lower(k)) == effect then | |||
entry = v | |||
break | |||
end | |||
end | |||
if not entry then | |||
local cat = '[[Category:Pages Referencing Unknown Extra Effects]]' | |||
return tostring(tt._main({ displaytext })) .. cat | |||
end | |||
local tooltiptext = entry.header .. ': ' .. entry.effect | |||
return tt._main({ displaytext, tooltiptext }) | |||
end | end | ||
return p | return p | ||