Editing Module:AbilityInteractionGive feedback
Jump to navigation
Jump to search
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: | ||
-- To add an interaction, add a REGISTRY entry: | -- To add an interaction, add a REGISTRY entry: | ||
-- aliases = other names resolving to this entry | -- aliases = other names resolving to this entry; assumed not to overlap | ||
-- title = header text | -- title = header text | ||
-- type = positive | negative | info | -- type = positive | negative | info | ||
-- iconfile = image file name, without the | -- iconfile = image file name, without the File: prefix | ||
-- link = wiki page name, or a full URL | -- link = wiki page name, or a full URL | ||
local REGISTRY = { | local REGISTRY = { | ||
['ability duration'] = { | ['ability duration'] = { | ||
aliases = { 'duration', 'duration extender' }, | aliases = { 'duration', 'duration extender' }, | ||
| Line 20: | Line 21: | ||
iconfile = 'Greater Expansion.png', | iconfile = 'Greater Expansion.png', | ||
link = 'Ability Range', | link = 'Ability Range', | ||
}, | }, | ||
['debuff resist'] = { | ['debuff resist'] = { | ||
| Line 41: | Line 35: | ||
iconfile = 'Dispel Magic.png', | iconfile = 'Dispel Magic.png', | ||
link = 'Dispel Magic', | link = 'Dispel Magic', | ||
}, | }, | ||
['heroic aura'] = { | ['heroic aura'] = { | ||
| Line 83: | Line 63: | ||
iconfile = 'Monster Rounds.png', | iconfile = 'Monster Rounds.png', | ||
link = 'Monster Rounds', | link = 'Monster Rounds', | ||
}, | }, | ||
['slowing hex'] = { | ['slowing hex'] = { | ||
aliases = {}, | aliases = {}, | ||
title = 'Slowing Hex', | title = 'Slowing Hex', | ||
type = ' | type = 'info', | ||
iconfile = 'Slowing Hex.png', | iconfile = 'Slowing Hex.png', | ||
link = 'Slowing Hex', | link = 'Slowing Hex', | ||
}, | }, | ||
['unstoppable'] = { | ['unstoppable'] = { | ||
| Line 127: | Line 86: | ||
for _, entry in pairs(REGISTRY) do | for _, entry in pairs(REGISTRY) do | ||
for _, alias in ipairs(entry.aliases or {}) do | for _, alias in ipairs(entry.aliases or {}) do | ||
index[ | index[alias] = entry | ||
end | end | ||
end | end | ||
for key, entry in pairs(REGISTRY) do | for key, entry in pairs(REGISTRY) do | ||
index[ | index[key] = entry | ||
end | end | ||
| Line 181: | Line 140: | ||
table.sort(keys) | table.sort(keys) | ||
local out = { '{| class="wikitable"', '! Interaction !! Example' } | local out = { '{| class="wikitable"', '! Interaction !! Aliases !! Type !! Example' } | ||
for _, key in ipairs(keys) do | for _, key in ipairs(keys) do | ||
local entry = REGISTRY[key] | local entry = REGISTRY[key] | ||
local | local aliases = {} | ||
for _, alias in ipairs(entry.aliases or {}) do | for _, alias in ipairs(entry.aliases or {}) do | ||
table.insert( | table.insert(aliases, '<code>' .. alias .. '</code>') | ||
end | end | ||
table.insert(out, '|-') | table.insert(out, '|-') | ||
table.insert(out, '| ' .. table.concat( | table.insert(out, '| <code>' .. key .. '</code>') | ||
table.insert(out, '| ' .. (#aliases > 0 and table.concat(aliases, ', ') or '—')) | |||
table.insert(out, '| ' .. entry.type) | |||
table.insert(out, '| ' .. frame:expandTemplate{ | table.insert(out, '| ' .. frame:expandTemplate{ | ||
title = 'AbilityInteraction', | title = 'AbilityInteraction', | ||